简体   繁体   English

Android SDK找不到JDK

[英]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. 我正在使用Windows 7 64位系统的installer_r20.0.1-windows(安装文件)安装Android sdk。 Alongside i am installing jdk for it using this jdk-7u5-windows-x64(setup file) for windows. 我旁边正在为此Windows使用此jdk-7u5-windows-x64(安装文件)为其安装jdk。 I installed the jdk and tried going back and forth so that the sdk recognizes the jdk but it is not doing so. 我安装了jdk并尝试来回移动,以便sdk识别出jdk,但事实并非如此。 Please suggest me what should i do? 请建议我该怎么办? Also if there is any issue of 32 bit and 64 bit installation please tell me... 另外,如果有任何32位和64位安装问题,请告诉我...

Here's my experience. 这是我的经验。 I installed jdk-7u9-windows-x64 and then attempted to install Android SDK (installer_r21-windows). 我安装了jdk-7u9-windows-x64,然后尝试安装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. 错误:找不到“ C:\\ Windows \\ system32 \\ java.exe”的Java版本:[2]系统找不到指定的文件。

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. 1)使用实际路径(如果变化)创建JAVA_HOME = "C:\\Program Files\\Java\\jdk1.7.0_09"的环境变量。

2) Modify the Path environment variable so that it includes the bin folder of JDK installation. 2)修改Path环境变量,使其包含JDK安装的bin文件夹。 The caveat here is that it needs to be before "%SystemRoot%\\system32" 需要注意的是,它必须在“%SystemRoot%\\ system32”之前

ie PATH ≈ 即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. 我不确定选项2是否违反public jre和jdk private jre的原则,因此通常我建议使用选项1并将jdk的bin目录添加到path env变量的末尾

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. 对我来说,尽管没有(现在)仍将JDK v7用于Eclipse和我的开发环境,但在没有安装JDK v6的情况下安装SDK时遇到了麻烦。

See if this works for you: Install JDKv6, then run SDK installer. 查看这是否适合您:安装JDKv6,然后运行SDK安装程序。 It should (hopefully) detect the JDK installation and continue. 它应该(希望)检测JDK的安装并继续。 After installation, uninstall JDKv6 and now install JDKv7 and continue from there. 安装后,请卸载JDKv6,然后安装JDKv7,然后从那里继续。

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. 我先安装了JDK(v7,x64),然后Android SDK告诉我找不到JDK。 Then I deleted C:\\Windows\\System32\\java.exe (actually I renamed to exjava.exe) and restarted Android install and worked fine. 然后我删除了C:\\ Windows \\ System32 \\ java.exe(实际上我重命名为exjava.exe),然后重新启动了Android安装并正常运行。 I hope it helps, good luck. 希望对您有帮助,祝您好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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