[Android] "failed to find Java version for 'C: \ windows \ system32 \ java.exe" SOLUTION

Source: Internet
Author: User
Impossible to install SDK R17 on win 7x64

"Failed to find Java version for 'C: \ windows \ system32 \ java.exe" SOLUTION

OS: Windows 7x86 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 = %
+ For/F % A in ('% ~ Dps0 \ find_java.exe ') do set java_exe = %

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)

The red part is the solution. In this method, the android SDK of the zip package is used, instead of the EXE format, and then the Android-SDK-Windows \ tools \ Lib \ find_java.bat

File:

-For/F % A in ('% ~ Dps0 \ find_java.exe-s ') do set java_exe = %
+ For/F % A in ('% ~ Dps0 \ find_java.exe ') do set java_exe = %

Then run Android. bat.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.