java JAVA_HOME 指向错误的地方
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1951083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
JAVA_HOME points to the wrong place
提问by Ankur
I seem to have an incorrectly specified JAVA_HOME variable. I can get around it for many things but now I am seem to be stuck. I am trying to use the Google App Engine and upload an application.
我似乎有一个错误指定的 JAVA_HOME 变量。我可以解决很多问题,但现在我似乎被卡住了。我正在尝试使用 Google App Engine 并上传应用程序。
When I do so I get the error that the error:
当我这样做时,我收到错误消息:
cannot find javac executable based on java.home, tried "C:\Program Files\Java\jre6\bin\javac.exe" and "C:\Program Files\Java\bin\javac.exe"
找不到基于 java.home 的 javac 可执行文件,尝试了“C:\Program Files\Java\jre6\bin\javac.exe”和“C:\Program Files\Java\bin\javac.exe”
I don't understand why it is looking there, doing echo %JAVA_HOME% gives me:
我不明白为什么它在那里看,做 echo %JAVA_HOME% 给了我:
C:\Program Files\Java\jdk1.6.0_14
C:\Program Files\Java\jdk1.6.0_14
Which is where Java actually is. I am thinking my best hope might be to just put Java where it is looking for it - can you think of anything better.
这就是 Java 的实际所在。我想我最大的希望可能是把 Java 放在它正在寻找的地方——你能想到什么更好的吗?
回答by ZoogieZork
Looks like it's possibly a bug:
看起来这可能是一个错误:
http://code.google.com/p/googleappengine/issues/detail?id=1226
http://code.google.com/p/googleappengine/issues/detail?id=1226
There are lots of suggested workarounds/solutions, but comment #24in the bug entry seems promising:
有很多建议的解决方法/解决方案,但错误条目中的评论 #24似乎很有希望:
The problem is that GAE plugin for Eclipse is default configured with a JRE instead of a JDK.
To change this, do the following:
Preferences > Java > Installed JRE's > Add... For 'JRE Type' select 'Standard VM' > Next > Directory: select your JDK directory (instead of JRE) (in my case: C:\Program Files\Java\jdk1.6.0_16 ), press OK.
Now, you are back at 'Installed JRE's', select the JDK here also.
问题是 Eclipse 的 GAE 插件默认配置了 JRE 而不是 JDK。
要更改此设置,请执行以下操作:
Preferences > Java > Installed JRE's > Add... 对于'JRE Type'选择'Standard VM' > Next > Directory:选择你的JDK目录(而不是JRE)(在我的例子中:C:\Program Files\Java\jdk1. 6.0_16 ),按确定。
现在,您返回到“已安装的 JRE”,在这里也选择 JDK。
回答by Sundar
Double check for any typo in the JAVA_HOME path.
仔细检查 JAVA_HOME 路径中是否有任何拼写错误。
回答by Wizzard
Or simply add "C:\Program Files\Java\jdk1.6.0_14\bin" to your %PATH%
或者只需将“C:\Program Files\Java\jdk1.6.0_14\bin”添加到您的 %PATH%

