简体   繁体   中英

Android SDK does not find JDK

I am installing the Android sdk using the installer_r20.0.1-windows(setup file) for windows 7 64 bit system. Alongside i am installing jdk for it using this jdk-7u5-windows-x64(setup file) for windows. I installed the jdk and tried going back and forth so that the sdk recognizes the jdk but it is not doing so. Please suggest me what should i do? Also if there is any issue of 32 bit and 64 bit installation please tell me...

Here's my experience. I installed jdk-7u9-windows-x64 and then attempted to install Android SDK (installer_r21-windows). It responds with:

Error: Failed to find Java version for 'C:\\Windows\\system32\\java.exe': [2] The system cannot find the file specified.

Two solutions worked for me:

1) Create an environment variable of JAVA_HOME = "C:\\Program Files\\Java\\jdk1.7.0_09" using your actual path if it varies.

2) Modify the Path environment variable so that it includes the bin folder of JDK installation. The caveat here is that it needs to be before "%SystemRoot%\\system32"

ie PATH ≈

C:\Program Files\Java\jdk1.7.0_09\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;`

instead of:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jdk1.7.0_09\bin`

I'm not sure if option 2 goes against the principles of the public jre vs the jdk private jre, so in general I recommend using option 1 and adding the bin directory of your jdk to the end of your path env variable.

For me, I had trouble installing the SDK without having JDK v6 installed, though I still (now) use JDK v7 for Eclipse and my dev environment.

See if this works for you: Install JDKv6, then run SDK installer. It should (hopefully) detect the JDK installation and continue. After installation, uninstall JDKv6 and now install JDKv7 and continue from there.

Andoid sdk与jdk 7不兼容,您应该使用最新版本的32位jdk 6。

I installed the JDK first (v7, x64), then Android SDK told me that it can not find JDK. Then I deleted C:\\Windows\\System32\\java.exe (actually I renamed to exjava.exe) and restarted Android install and worked fine. I hope it helps, good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM