Fatal error compiling: tools.jar not found:

103,944

Solution 1

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... :)

Solution 2

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 ;)

Share:
103,944

Related videos on Youtube

Uppi
Author by

Uppi

Updated on December 26, 2020

Comments

  • Uppi
    Uppi over 3 years

    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?

    • khmarbaise
      khmarbaise almost 10 years
      Di you try to run the build on command line?
    • Uppi
      Uppi almost 10 years
      yes..its working fine in command line.
    • MikeJRamsey56
      MikeJRamsey56 about 8 years
      One more place to check is the JRE tab on the Maven Build Run Configuration window.
    • Manish Kumar
      Manish Kumar over 4 years
      Even i faced this issue. It was a eclipse config problem related to JRE. sudotutorials.com/java/870/…
  • Uppi
    Uppi almost 10 years
    Dont see a libraries section when hit alt+enter!!!
  • Valentin Montmirail
    Valentin Montmirail almost 10 years
    Ok, so : right-click on your project, and then, properties
  • Uppi
    Uppi almost 10 years
    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
    Uppi almost 10 years
    Yes I DId. Now it shoes this error.Posted in the Question
  • Uppi
    Uppi almost 10 years
    All the build runs fine in the command prompt, But not sure exactly the problem with eclipse.
  • Valentin Montmirail
    Valentin Montmirail almost 10 years
    OK you should configure your run configurations if the problem change to this :) Your maven goal should be something like : clean install
  • Uppi
    Uppi almost 10 years
    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
    Uppi almost 10 years
    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
    Uppi almost 10 years
    HTTP Status 404 - /xxx/ and also has a unhandled event loop exception->plugin> org.eclipse.ui in the error log... :|
  • Valentin Montmirail
    Valentin Montmirail almost 10 years
    O.o OK maybe you have a proxy or something, and your maven don't succeed to download packages... :/ maven.apache.org/guides/mini/guide-proxies.html
  • Uppi
    Uppi almost 10 years
    I dont have a settings.xml file under my repository!!!
  • JavaTec
    JavaTec about 8 years
    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
  • JGFMK
    JGFMK over 6 years
    @JavaTec Better to add Windows -> Preferences....