您需要使用JDK运行构建或在类路径上具有tools.jar [英] You need to run build with JDK or have tools.jar on the classpath
问题描述
我正在使用Eclipse Luna开发Java Maven应用程序.
I'm using Eclipse Luna to develop java maven applications.
我现在曾经(或曾经是),但现在又是,现在使用jdk1.7作为默认安装的JRE.
I am, or was, but am again now, using jdk1.7 as my default installed JRE.
从SVN更新后,我开始在pom.xml文件中收到此错误:
After an update from SVN that I made, I started getting this error on my pom.xml files:
You need to run build with JDK or have tools.jar on the classpath.
If this occures during eclipse build make sure you run eclipse under JDK as well
(com.mysema.maven:apt-maven-plugin:1.0.6:process:default:generate-sources)
我注意到我的jdk1.7安装由于某种原因而从eclipse中消失了. 我已经尝试过在stackoverflow上找到的所有选项,包括重新添加jdk1.7并将其设置为项目的JRE库,甚至在eclipse上将tools.jar添加到jdk1.7库中,但我我仍然遇到错误,这现在意义不大了.
I noticed that my jdk1.7 installation was GONE from eclipse somehow. I've tried all the options that I've found here on stackoverflow about re-adding that jdk1.7 and setting it as my project's JRE library and even adding the tools.jar to the jdk1.7 library on eclipse, but I'm still getting the error, which makes very little sense now.
推荐答案
尝试将其设置为eclipse.ini文件,然后重新启动eclipse以确保它也使用了您的JDK:
Try setting this to your eclipse.ini file and restarting eclipse to make sure that it's also using your JDK:
-vm
C:\jdk1.7\bin\javaw.exe
注意:
- 此值必须位于
-vmargs
的正上方
- 您到虚拟机的完整路径可能与上面的路径不同
- this must go just above
-vmargs
- you're full path to your VM maybe different than the one above
请参见此作为参考.
这篇关于您需要使用JDK运行构建或在类路径上具有tools.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!