0

After studying This and This, running the SDK manager from the ADT still prompts an error from the console log:

C:\Program Files\Java\jdk1.7.0_25\bin\java.exe -jar lib\archquery.jar is not recognized as an internal or external command, operable program or batch file.
Invalid path
The system cannot find the file specified.

I promise I can find the java.exe file, and lib\archquery.jar does exist, but the batch file just show the same error again.
I have changed the find_java.bat file to

set javaw_exe=C:\Program Files\Java\jdk1.7.0_25\bin\javaw.exe

to directly locate the java.exe and javaw.exe files.

I don't know what happened at all? Can someone offer me the correct batch file? (I download it on 2013/8/1, I can't find older one)

Thanks.

Community
  • 1
  • 1
Alston
  • 2,085
  • 5
  • 30
  • 49

2 Answers2

1

modify android.bat

  1. comment out line 36 that tries to detect where java.exe is located and hardcode location :

set java_exe=C:\Program Files\Java\jdk1.7.0_51\bin\java.exe rem call lib\find_java.bat

  1. Comment out line 43 that tries to detect current architecture (x86 or x86_64) and hardcode accordingly :

rem for /f "delims=" %%a in ('"%java_exe%" -jar lib\archquery.jar') do set swt_path=lib\x86_64

Konstantin
  • 3,294
  • 21
  • 23
0

I would suggest you to set up the Environment variables using How do I set or change the PATH system variable?.

For now, open command prompt. Change directory to the bin directory(@ C:\Program Files (x86)\Java\jdk1.7.x_xx\bin) and issue this command:

java -jar ..\lib\archquery.jar

The lib directory is one level up and .. will get you the parent directory.

Vikram
  • 51,313
  • 11
  • 93
  • 122
  • But the script is written in `android.bat`, it calls the `java_exe` and the `jar` file is the target. Where should I edit it? – Alston Aug 02 '13 at 13:13
  • Yes, I have set my system PATH variable to `~\jdk~\bin` directory. – Alston Aug 02 '13 at 13:28
  • @Stallman Not sure what's wrong here. You are welcome to take a look at `android.bat` that I have: [Link](https://www.dropbox.com/s/8am1mh4ax0dmmad/android.bat). – Vikram Aug 02 '13 at 13:42
  • C:\Program Files\Java\jdk1.7.0_25\bin\java.exe -jar lib\archquery.jar' is not recognized as an internal or external command, Same warning result even using your bat file. – Alston Aug 02 '13 at 14:39
  • @Stallman As a last resort, check if java bin directory is located at `C:\Program Files\Java\jdk1.7.0_25\` or `C:\Program Files (x86)\Java\jdk1.7.0_25\`, and that both Path variable(user and system) are set. Else, follow `Ray Trask's` advice. – Vikram Aug 02 '13 at 14:45