When run maven project in Eclipse, you probably encounter the below error:
OK. The problem is solved.
Unable to locate the Javac Compiler in:
C:\Program Files\Java\jre1.6.0_07\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
The reason is that m2eclipse plugin want to find the tools.jar in JDK_HOME/lib folder. That
means you must install JDK to execute maven in Eclipse.
In Eclipse, you can configure the JRE included in JDK directory.
![[ERROR] Unable to locate the Javac Compiler in - wengm - Bruce Wen的成长历程](http://img0.ph.126.net/fgUQB_rYc0G0rxcriDVS4w==/6597630517586238690.jpg)
Then, configure JRE of maven Run Configuration as workspace default JRE.
![[ERROR] Unable to locate the Javac Compiler in - wengm - Bruce Wen的成长历程](http://img8.ph.126.net/LDtVSWtv5TRrrQE0y8Tdmg==/6597905395493182658.jpg)