Unable to access jarfile lib\archquery.jar

2019-03-12 17:44发布

Problem:

  • Unable to open SDK Manager (Flashes only for a second)
  • No build path target in Eclipse

Paths:

Android SDK: C:\Program Files\Android\android-sdk
JDK used for android: C:\Program Files\Java\jdk1.7.0_04 (There are other JDKs also in dir Java)

Environment Variables:

ANDROID_SDK_HOME: C:\Program Files\Android\android-sdk
JAVA_HOME: C:\Program Files\Java\jdk1.7.0_04;C:\Program Files (x86)\Java\jre1.6.0;C:\Program Files\Java\jre7;
System Path: C:\Program Files\Java\jdk1.7.0_04\bin;C:\Program Files\Java\jdk1.7.0_01\bin;C:\Program Files (x86)\Java\jdk1.5.0\bin;C:\Program Files\Android\android-sdk\tools\

Errors:

SDK Manager on cmd
Failed to execute tools\android.bat. 
The system cannot find the file specified

Android.bat on cmd
Unable to access jar file lib\archquery.jar
Invalid path

find_java on cmd
nothing returned

7条回答
来,给爷笑一个
2楼-- · 2019-03-12 18:41

On Windows 7, at least, a batch 'FOR' loop, when executing a command for the list, does not use the current working directory, but the root. In this case, the command is '%java_exe% -jar lib\archquery.jar'. However, it's effectively being run from the root, e.g. 'C:\'. You can see this for your self with this simple test from the command line:

for /f %a in ('CD') do echo %a

So the command to run archquery is looking for the jar relative to the root directory, not your ADT directory, and thus can't be found.

查看更多
登录 后发表回答