[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project ERP: Compilation failure[ERROR] Unable to locate the Javac Compiler in:[ERROR] C:\Program Files\Java\jre7\..\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
Solution
Step 1:Window-> preferences-> JAVA-> installed jres-> click "add", select the default "Standard VM", and click "next> ", click "directory" on the right of "JRE home" and select the directory c: \ Program Files \ Java \ jdk1.7.0 _ 60 \ JRE. Click "OK" to go back to the "installed jres" interface, select the added "jdk1.7.0 _ 60 ".
Step 2:Window-> preferences-> JAVA-> installed jres->Click "JaveSE-1.7" on the left of the interface, and then select "jdk1.7.0 _ 60" on the right ".
Step 3:Add the following two lines to the <eclipse installation directory>/eclipse. ini file: (Be sure to add them before-startup. Note the following two lines ):
-vmC:\Program Files\Java\jdk1.7.0_60\jre\bin\javaw.exe
Step 4:Restart eclipse. Everything is OK.
Problem Analysis
The system has two JRE. The JRE in JDK should be used.
java|—jdk1.7.0_60 |—jre|—jre7
The system uses Java/jre7 by default, but this directory does not contain tools. jar. Therefore, you need to use Java/jdk1.7.0 _ 60/JRE. The directory contains the tools. jar package.