[Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"
2013-09-27 20:48
471 查看
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开发怎么查看和管理sqlite数据库
- Android开发之解析JSon数据(二)
- 抽屉显示控件SlidingDrawer入门
- android图标设计事宜
- android工程混淆和反编译
- 我的Android进阶之旅------>Android安全退出应用程序的几种方式
- Android sqlite数据库存取图片信息
- Android四大基本组件介绍与生命周期
- Android基础之退出应用程序Demo
- Android基础之响应Menu键弹出菜单Demo
- 【Android】Activity的菜单机制和方法解析
- Android listView scroll 恢复滚动位置
- Android应用程序键盘(Keyboard)消息处理机制分析(9)
- 适应多行长文本的Android TextView
- 【Android】添加菜单和监听菜单方法详解
- android文体风格建议
- 开源侧滑菜单SlidingMenu主要方法介绍
- android 内存优化以及性能优化相关问题
- Android输入输出机制之来龙去脉之前生后世
- Android根据用户设置决定是否在开机时启动应用程序