[Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"问题的解决方法
2012-05-10 23:44
851 查看
Impossible to install SDK r17 on win 7 x64
"Failed to find Java version for 'C:\Windows\system32\java.exe"问题的解决方法
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)
红字部分为解决方法,这种方法需要使用zip包的Android SDK,而不能使用exe格式的,然后在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
然后再运行android.bat就可以了。
"Failed to find Java version for 'C:\Windows\system32\java.exe"问题的解决方法
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)
红字部分为解决方法,这种方法需要使用zip包的Android SDK,而不能使用exe格式的,然后在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
然后再运行android.bat就可以了。
相关文章推荐
- android中遇到java.lang.NumberFormatException: unable to parse 'null' as integer此类问题的原因及解决方法
- [Android][Rendering Problems] Failed to find style 'editTextStyle' in current theme 解决方法
- 安装Android Studio报failed to find java version for 'C:windowssystem32java.
- Java解析DBF文件,错误Failed to parse Number: For input string: "-.---" 或读取不出数据或乱码问题都在这里解决
- [Android][Build Problems] failed to find build tools revision & failed to find target android 等问题解决
- Java解析DBF文件,错误Failed to parse Number: For input string: "-.---" 或读取不出数据或乱码问题都在这里解决
- CS2018: Unable to find messages file 'cscui.dll' 这个问题的解决方法!
- Android问题:Test run failed: Instrumentation run failed due to 'java.lang.RuntimeException'
- Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'问题解决方法
- Failed to read schema document 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'问题解决方法
- 关于android Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.的解决方法
- [Trouble Shoot]hibernate中的Failed to load class "org.slf4j.impl.StaticLoggerBinder"问题的解决方法
- 解决android studio ADB无响应的问题:If you'd like to retry,then please manually kill "adb.exe"
- git 错误: Unable to find remote helper for 'https'解决方法
- : java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy 解决方法
- 使用ACE日志策略时遇到的问题:DLL::open failed for ACE: Error: check log for details Unable to find service 'Logger'
- git 错误: Unable to find remote helper for 'https'解决方法
- 我的Android进阶之旅------>解决:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
- 解决android studio ADB无响应的问题:If you'd like to retry,then please manually kill "adb.exe"
- Android - "cause failed to find target android-14" 问题