Maven Unable to Locate Javac Compiler tools.jar

By Arvind Rai, August 22, 2013
Most of us who are new to maven with eclipse, faces the below error.
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
 
This is because maven is not getting jdk compiler, we need to tell maven to pick JRE , from the path JAVA_HOME. To do this follow the steps.

1. Right click on pom.xml and go to Run As->Run Configurations.

Maven Unable to Locate Javac Compiler tools.jar

2. Click on JRE tab. Check if option workspace default is your JAVA_HOME, then select this option.
3. Or go to alternate JRE and select JAVA_HOME.
4. Now run and check.
POSTED BY
ARVIND RAI
ARVIND RAI
LEARN MORE








©2024 concretepage.com | Privacy Policy | Contact Us