Eclipse, Maven, and JDK 1.8

Error:

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

Make sure you uninstall the older version of Java from your computer

I had Java 7 installed and then I installed Java 8 on top of it. Go to Program Features and remove all Java 7s.

Launch Eclipse with your JDK:

in eclipse.ini, add -vm [path to your 1.8 jdk] ABOVE -vmargs

In Eclipse, open Window > Perference > type Installed JREs

Add your JDK there as a Standard VM, ensure it is checked, apply.

If your maven project still give you the error, add the jdk to the build path of your project

Right click your project > Build Path > Configure Build Path > go to Libraries tab

Add Library > find your jdk that you added to Eclipse

move the JDK to the top, remove other JRE from the build path window.

My maven project can build without error now. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s