我与 JAVA_HOME
配置有一些冲突当我使用以下代码时 -
I have some conflicts with the JAVA_HOME
configuration
When I using the following code -
System.out.println(System.getenv("JAVA_HOME"));
我得到 - C:jdk1.6.0_23
这是正确的地方.但是,当我在 Android build.xml 上运行 Ant 命令时,我收到以下错误消息 -
I get - C:jdk1.6.0_23
which is the correct place.
But, When I run Ant command on an Android build.xml, I got the following error message -
C:android-sdk-windows oolsantmain_rules.xml:361:找不到javac编译器;com.sun.tools.javac.Main 不上类路径.也许 JAVA_HOME 没有指向JDK.目前已设置到C:jdk1.6.0_23jre"
C:android-sdk-windows oolsantmain_rules.xml:361: Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to "C:jdk1.6.0_23jre"
如何解决?
谢谢,
艾尔
要将 Windows 下的 JAVA_HOME 环境变量永久设置为您提到的 JDK 目录,请执行以下操作:
To permanently set your JAVA_HOME Environment Variable under Windows to the JDK directory you've mentioned do the following:
输入以下内容:
Enter the following:
Variable name: JAVA_HOME
Variable value: C:jdk1.6.0_23
如果您使用的是 Eclipse,请跳过上述步骤并执行以下操作:
If you are using Eclipse then skip the steps above and do the following:
但是,在您的情况下,您最好的选择可能是简单地将 C:jdk1.6.0_23in 附加到您的 PATH 环境变量中,使用我上面的第一组说明作为粗略指导.
In your situation however your best bet would probably be to simply append C:jdk1.6.0_23in to your PATH env var using my first set of instructions above as a rough guideline.
这篇关于在 Android SDK 中设置 JAVA_HOME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!