本文来自:http://www.xuebuyuan.com/2083610.html
在使用eclipse 运行maven install的时候,出现这个错误:Unable to locate the JavacCompiler in:…
1、问题描叙
我使用的Eclipse的是 :
Eclipse Java EE IDE for WebDevelopers.
Version: Kepler Service Release1
Buildid: 20130919-0819
Maven:Eclipse自带的
异常情景:
在使用eclipse 运行 maveninstall的时候,出现这个错误:
ERROR:Unable to locate the Javac Compiler in:, C:\Program Files(x86)\Java\jre6\..\lib\tools.jar,Please ensure you are using JDK 1.4 or aboveand,not a JRE (the com.sun.tools.javac.Main class is required).,In most casesyou can change the location of your
Java ,installation by setting the JAVA_HOMEenvironment variable.
2、尝试解决办法:
2.1:打开 :Window -> Preferences -> Java -> installed JREs ->
选择你正在使用的JRE(应该是一个在jdk。例:C:\Program Files\Java\jdk1.6.0_43 )
2.2 、接着,点击“Edit”,进入下一个画面:选择添加C:\Program Files\Java\jdk1.6.0_43\lib\tools.jar ,点击Finish。
2.3、接下来,打开 Window -> Preferences -> Java -> installed JREs ->Execution Enviroments ->
进入画面:选择JavaSE-1.6和相匹配的 jre。点击OK。
到此,重新运行 maven install。成功!