简体   繁体   English

Android SDK工具向导:检测JDK 1.7而不是JDK 1.6

[英]Android SDK Tools Wizard: Detects JDK 1.7 instead of JDK 1.6

I am trying my hands on Android first time ever, so request you to pardon me if I sound too naive. 我是第一次尝试使用Android,因此如果我听起来太幼稚,请您原谅我。 I read on the ADT system requirements that it needs JDK 1.6 and also some of the tutorials it was said that ADT doesn't support JDK 1.7 yet. 我读到ADT系统要求它需要JDK 1.6,并且还读了一些教程,据说ADT还不支持JDK 1.7。

I have both JDK 1.7 and JDK 1.6 ( also the JREs ) on my machine and I have set the JAVA_HOME to JDK 1.6. 我的机器上同时装有JDK 1.7和JDK 1.6(也有JRE),并且将JAVA_HOME设置为JDK 1.6。 I tested by typing java -version and it shows me pointed to Java 1.6. 我通过键入java -version进行了测试,它表明我指向Java 1.6。

Java版本

However, when I run the Android SDK Tools Wizard it detects JDK 1.7 instead of 1.6. 但是,当我运行Android SDK工具向导时,它将检测到JDK 1.7而不是1.6。 I am not sure if continuing with JDK 1.7 would lead to future problems during development. 我不确定继续使用JDK 1.7是否会在开发期间导致将来的问题。

Android SDK工具向导

Please advise if this fine. 请告知是否可以。 Else, please suggest how can I correctly get this pointed to JDK 1.6. 否则,请提出如何正确指向JDK 1.6的建议。 Note: I don't want to uninstall 1.7 as I need it for other development activities. 注意:我不想卸载1.7,因为其他开发活动需要它。

also some of the tutorials it was said that ADT doesn't support JDK 1.7 yet 还有一些教程,据说ADT还不支持JDK 1.7

ADT supports Java 1.7 (aka, Java 7). ADT支持Java 1.7(又名Java 7)。

I tested by typing java -version and it shows me pointed to Java 1.6 我通过键入java -version进行了测试,它表明我指向Java 1.6

Note that this is testing the runtime environment, not the development environment. 请注意,这是在测试运行时环境,而不是开发环境。 Use javac -version to test what version of the Java compiler you are using. 使用javac -version测试您使用的Java编译器版本。

I am not sure if continuing with JDK 1.7 would lead to future problems during development 我不确定继续使用JDK 1.7是否会在开发期间导致将来的问题

That should be fine. 那应该没问题。 I have been using Java 7 for the past 5-6 months without issue, albeit on Linux rather than Windows. 在过去的5-6个月里,尽管在Linux而非Windows上,我一直在使用Java 7,没有出现任何问题。

Here is answer to my question: 这是我的问题的答案:

It seems the wizard was reading the JDK and JRE environment values from the Registry ( on Windows ) ie HKEY_LOCAL_MACHINE variable. 似乎向导正在从注册表(在Windows上)中读取JDK和JRE环境值,即HKEY_LOCAL_MACHINE变量。 I changed the variable values there from 1.7 to 1.6 and it started picking up 1.6 我将变量值从1.7更改为1.6,然后开始提高1.6

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

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