gpt4 book ai didi

android - JAVA_HOME 与 Android SDK 冲突

转载 作者:行者123 更新时间:2023-12-01 14:19:38 25 4
gpt4 key购买 nike

当我尝试构建 Android 应用程序时,出现以下错误:

Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "C:\Program Files (x86)\Java\jre7"

但是系统环境变量JAVA_HOME实际上设置为“C:\Program Files\Java\jdk1.7.0_25”

我们这里为 JAVA_HOME 有两个不同的值

这种冲突从何而来?

最佳答案

要将 Windows 下的 JAVA_HOME 环境变量永久设置为您提到的 JDK 目录,请执行以下操作:

Click Start, right click on Computer and select properties (you can also hold down the windows key and press the pause/break key).
Click on Advanced system settings on the left.
Click the Environment Variables button on the bottom.
Click the New... button below the System variables window.

Enter the following:

Variable name: JAVA_HOME
Variable value: C:\jdk1.6.0_23\

Click Ok, Ok, Ok, and close the system control panel you opened in step 1
Close and re-open your command prompt.

如果您使用的是 Eclipse,则跳过上述步骤并执行以下操作:

Click on the Window menu and choose Preferences.
Expand the Ant entry on the left and click on Runtime
Click on Global Entries in the Classpath tab on the right.
Click Add External JARs...
Navigate to C:\jdk1.6.0_23\lib and select tools.jar then click open.
Hit ok to Close the preferences Window.

在您的情况下,您最好的选择可能是简单地使用我的第一组指令将 C:\jdk1.6.0_23\bin 附加到您的 PATH 环境变量以上作为粗略指南。

关于android - JAVA_HOME 与 Android SDK 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17733759/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com