Maven – Fatal error compiling: tools.jar not found

You might quite experience the tools.jar not found when trying to compile using Maven.  This is because when you do the compilation, maven is trying to look for a tools.jar which is not available for the compilation and hence you get this exception.


Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre6\..\lib\tools.jar -> [Help 1]


Make sure, you have the JDK in the installed JRE and selected for your compilation needs.

In Eclipse,

Goto Windows -> Preferences
Java -> Installed JREs – > Execution Environment
JavaSE1.x -> JDE 1.x

Eclipse Preferences
Eclipse Preferences

If you don’t have the JDK in the Installed JRE, then
Select the Installed JRE and Add the JDK installed path


  • Manoj says:

    Really very nice very useful.

    thanks a lot.

  • ASB says:

    Thank you very much!

  • Wingzzz says:

    Yeah this helped solve my issue real quick! Thanks a million for the great post!

  • mimil says:

    thanks ! I downloaded full JDK.

  • ajayram198 says:

    Hi I am new to Maven and Java, and while running a Hello World Program using Maven I am getting a warning and an error
    which: no javac in (/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/milli/bin)
    Warning: JAVA_HOME environment variable is not set.

    Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project M101J: Fatal error compiling: tools.jar not found: /usr/java/jre1.6.0_22/../lib/tools.jar -> [Help 1]


    I dont have any IDE installed on my machine, Is it required to have an IDE? And how do you resolve this problem on a Linux machine?

    • Muruga says:

      You don’t need to install IDE.

      no javac in (/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/milli/bin)

      which means that your is not on the path. export JAVA_HOME to your JDK path (up to the BIN directory). Once you do it, you should be able to run Maven.

  • Carlos Ramirez says:


    Thank you very much, it worked perfectly


  • Anusha says:

    Thank you, it worked. I had to add JDK in my installed JREs and select that path. This post is really helpful.

  • Mubarak Ali says:

    Thank you very much. I have been stuck in this problem since last two days and your proposed solution solved it for me in a minute.
    P.S. I am using STS on windows 8. Also, after clicking on the Add JRE button, I select the last option (Standard something VM) . Then I browse to my Java/jdk/jre folder and not the java/jre folder. Just mentioning for someone who stuck like me.

  • Kiran says:

    Thanks alot. This helped me.

  • rajesh says:

    Thanks, Worked ..!!

Leave a Reply