[Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"

Impossible to install SDK r17 on win 7 x64java

"Failed to find Java version for 'C:\Windows\system32\java.exe"問題的解決方法android

OS: Windows 7 x86 64bit
JDK installed: http://download.oracle.com/otn-pub/java/jdk/7u3-b05/jdk-7u3-windows-x64.exe

Option #1
Execute Android SDK installer 
http://dl.google.com/android/installer_r17-windows.exe

Actual result - it can not find JAVA on the system. 

Environment variable JAVA_HOME, PATH and recommendation from different forums about registry key didn't help (like here http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/)

Option #2
Execute tools/android.bat from 
http://dl.google.com/android/android-sdk_r17-windows.zip

Actual result:
Failed to start with the error in console: "Failed to convert path to a short DOS path: C:\Windows\system32\java.exe"

How I fixed this: 
In the file android-sdk-windows\tools\lib\find_java.bat 
-for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
+for /f %%a in ('%~dps0\find_java.exe') do set java_exe=%%a

Suggestions - it is obvious that find_java.exe has a bug in conversion long names to short one (at least if no any conversion is required)windows

紅字部分爲解決方法,這種方法須要使用zip包的Android SDK,而不能使用exe格式的,而後在android-sdk-windows\tools\lib\find_java.batoracle

文件中:wordpress

-for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
+for /f %%a in ('%~dps0\find_java.exe') do set java_exe=%%aui

而後再運行android.bat就能夠了。this

相關文章
相關標籤/搜索