[英]Android.bat can't run java
我知道這個問題已被解決,但是我仍然無法讓SDK Manager在Windows 7 Home上運行。
我下載了eclipse + adt軟件包。 SDK Manager.exe位於sdk文件夾中,我嘗試從中運行它。 我什至嘗試將其復制到tools文件夾並嘗試從那里運行,但是沒有運氣。
我得到的錯誤是:
Failed to execute tools\android.bat:
The system cannot find the file specified.
該文件顯然存在。 我也嘗試以“管理員”身份運行它。
接下來,我嘗試運行android.bat文件本身,內容為:
Windows cannot find 'E:\path\to\batfile'.
Make sure you typed the name correctly, and then try again.
然后,我以“管理員”身份運行它,至少它會檢測並嘗試執行它。 我在android.bat本身中添加了一些暫停語句,以防止其關閉。
這是我看到的:
'"E:\ADT\sdk\tools\lib\\find_java.exe" -s' is not recognized as an internal
or external command, operable program or batch file.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java JDK installed on your system.
We recommend that you install the JDK version of JavaSE, available here:
http://www.oracle.com/technetwork/java/javase/downloads
If you already have Java installed, you can define the JAVA_HOME environment
variable in Control Panel / System / Avanced System Settings to point to the
JDK folder.
不知道為什么這樣說,因為當我在cmd中的java中運行時,我得到了:
C:\Users\(MyUser)>where java
C:\Program Files\Java\jdk1.8.0_05\bin\java.exe
C:\ProgramData\Oracle\Java\javapath\java.exe
C:\Windows\System32\java.exe
當我打開cmd並手動運行時
'"E:\ADT\sdk\tools\lib\\find_java.exe" -s'
它工作正常。
然后我嘗試將android.bat中的java_exe設置為
set java_exe=C:\Program Files\Java\jdk1.8.0_05\bin\java.exe
注釋掉find_java之后,我再次運行它,這是我得到的:
'"C:\Program Files\Java\jdk1.8.0_05\bin\java.exe" -jar lib\archquery.jar' is not
recognized as an internal or external command,
operable program or batch file.
Invalid path
再一次,當我手動運行它時,我得到:
C:\Users\MyUser>"C:\Program Files\Java\jdk1.8.0_05\bin\java.exe" -jar E:\ADT\sdk\t
ools\lib\archquery.jar
x86_64
我是否缺少某些東西,還是我應該放棄嘗試使其在Windows機器上工作。
您的where java
顯示太多java.exe
, find_java.bat
也會嘗試在java
所在的文件夾中查找javaw
。
設置JAVA_HOME並確保echo %PATH%
指向您的主要jdk安裝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.