2013年6月7日金曜日

android.bat doesn't start up on Windows

Goal

I want Android SDK Manager to show up!



The problem

Console opens up for a split second, but closes immediately. If you run it from CMD command-line, you receive an error saying:  android.bat 'C:\Program' is not recognized as an...

Yeah, its yet another stupid "Program Files" folder related problem on Windows...

Fix

Make a copy of the original android.bat to something like android.bat_original
Open android.bat in a text editor
Look for a line that says: call lib\find_java.bat









Comment out call lib\find-java.bat line


Then add a full path to your local java.exe, within a pair of double-quotation marks.









That should work.

Details

"sdk\tools\lib" folder contains an executable file called find_java.exe. This little program seems to be working just fine. It figures out the correct full path to java.exe (and javaw.exe if you give -w switch).

"sdk\tools\lib" folder also contains find_java.bat script file, and this is the batch file we commented out above. This guy seems to have issue handling a white space in "<Drive>:\\Program Files\Java\....". Rather than trying to figure out how to make CMD batch file to work (which is a major pain), I recommend just set java_exe environment variable explicitly as shown above.


0 件のコメント:

コメントを投稿