22

When compiling a project in Eclipse, I get below error:

Fatal error compiling: tools.jar not found:

How is this caused and how can I solve it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Uppi
  • 702
  • 2
  • 13
  • 37

2 Answers2

42

Goto Windows -> Preferences

Java -> Installed JREs –> Execution Environment

JavaSE1.x -> JDE 1.x


If you don’t have the JDK in the Installed JRE, then

Select the Installed JRE and Add the JDK installed path


Let's try to configure your run configurations to clean install

enter image description here

Click on the small black arrow and then Run Configurations

After, you just put clean install in your Maven goal, like this :

enter image description here

And then, try to run your compilation, and we will see what happens... :)

Mohammad Faisal
  • 5,783
  • 15
  • 70
  • 117
Valentin Montmirail
  • 2,594
  • 1
  • 25
  • 53
  • Yes I DId. Now it shoes this error.Posted in the Question – Uppi Aug 07 '14 at 15:32
  • All the build runs fine in the command prompt, But not sure exactly the problem with eclipse. – Uppi Aug 07 '14 at 15:36
  • OK you should configure your run configurations if the problem change to this :) Your maven goal should be something like : clean install – Valentin Montmirail Aug 07 '14 at 15:38
  • I was showing a bunch of errors yesterday.An internal error occurred during: "Loading descriptor for xxx.". org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'taglib' not found. (platform:/resource/xxx/src/main/webapp/WEB-INF/web.xml, 226, 11). This was one of the errors yesterday – Uppi Aug 07 '14 at 15:39
  • This was an other one..Could not get the value for parameter encoding for plugin execution default-resources Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 ( – Uppi Aug 07 '14 at 15:40
  • HTTP Status 404 - /xxx/ and also has a unhandled event loop exception->plugin> org.eclipse.ui in the error log... :| – Uppi Aug 07 '14 at 16:06
  • O.o OK maybe you have a proxy or something, and your maven don't succeed to download packages... :/ http://maven.apache.org/guides/mini/guide-proxies.html – Valentin Montmirail Aug 07 '14 at 16:08
  • I dont have a settings.xml file under my repository!!! – Uppi Aug 07 '14 at 16:12
23

You need to put the right Java Build path for your project.

In Eclipse:

--> Right click the project name - Properties (keyboard shortcut: [Alt] + [Enter] )
--> Libraries
--> Change the JRE7 to JDK7.

And I think the problem will be solved that way ;)

Community
  • 1
  • 1
Valentin Montmirail
  • 2,594
  • 1
  • 25
  • 53
  • 2
    Dont see a libraries section when hit alt+enter!!! – Uppi Aug 07 '14 at 15:12
  • Ok, so : right-click on your project, and then, properties – Valentin Montmirail Aug 07 '14 at 15:14
  • 2
    I found the java build path Valentin, but It shows all the project jar files. I did change the path to JDk in the preferences->java->installed jre->jdk...But its not helping – Uppi Aug 07 '14 at 15:22
  • 4
    I had to create a JAVA_HOME variable within eclipse (go to preferences -> java -> build path -> class path variable) and point this to JDK7 - it started to work – JavaTec Feb 15 '16 at 17:54
  • @JavaTec Better to add Windows -> Preferences.... – JGFMK Jan 11 '18 at 17:48