find java.exe_[Android] "Failed to find Java version for 'C:\Windows\system32\java.exe"问题的解决方法...

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就可以了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值