Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
453 views
in Technique[技术] by (71.8m points)

java - You need to run build with JDK or have tools.jar on the classpath

I'm using Eclipse Luna to develop java maven applications.

I am, or was, but am again now, using jdk1.7 as my default installed JRE.

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)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try setting this to your eclipse.ini file and restarting eclipse to make sure that it's also using your JDK:

-vm
C:jdk1.7injavaw.exe

Cautions:

  • this must go just above -vmargs
  • you're full path to your VM maybe different than the one above

See this as reference.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...