[英]Why is Eclipse adding /jre to my JAVA_HOME
A colleague installed a new application for me today and has managed to mangle my PATH and my java environments. 一位同事今天为我安装了一个新应用程序,并设法处理了我的PATH和Java环境。 I think I have the critical stuff back, but java build in Eclipse (via ant) does not work.
我认为我有一些重要的东西,但是在Eclipse中(通过ant)的Java构建无法正常工作。 I get the following error:
我收到以下错误:
Unable to find a javac compiler;
找不到javac编译器; com.sun.tools.javac.Main is not on the classpath.
com.sun.tools.javac.Main不在类路径中。 Perhaps JAVA_HOME does not point to the JDK.
也许JAVA_HOME没有指向JDK。 It is currently set to "C:\\Java\\jdk\\jre"
当前设置为“ C:\\ Java \\ jdk \\ jre”
The really weird thing is that that is not what my JAV_HOME is set to! 真正奇怪的是那不是我的JAV_HOME设置的!
H:\>echo %JAVA_HOME%
C:\Java\jdk
Where is the extra \\jre
coming from? 多余的
\\jre
来自哪里?
I have also added C:\\Java\\jdk\\bin
to my PATH variable, so javac
is on the path: 我还添加了
C:\\Java\\jdk\\bin
到我的PATH变量,所以javac
是路径:
H:\>javac
Usage: javac <options> <source files>
where possible options include:
The line in the build.xml which the stack trace points to is a simple javac ant command: 堆栈跟踪指向的build.xml中的行是一个简单的javac ant命令:
<javac source="${webapps.javac_target}" target="${webapps.javac_target}" debug="on" destdir="${classes}" srcdir="${src}">
The default Installed JRE has location C:\\Java\\jdk
(and this is the one used by this project). 默认的已安装JRE的位置为
C:\\Java\\jdk
(这是此项目使用的位置)。 Even the eclipse.ini ensures that Eclipse uses the same JDK with 甚至eclipse.ini都确保Eclipse将相同的JDK与
-vm
C:\Java\jdk\bin\javaw.exe
Any ideas what I need to set to make this work again? 我需要设定什么想法才能再次进行这项工作?
I thought that the Installed JREs was correct. 我认为已安装的JRE是正确的。 I even downloaded a new JDK.
我什至下载了一个新的JDK。 In the end we discovered that it was pointing to the JDK root, not the JRE folder within.
最后,我们发现它指向的是JDK根目录,而不是其中的JRE文件夹。 Changing that solved my problem
改变解决了我的问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.