Eclipse maven 打包出错 : COMPILATION ERROR Unable to locate the Javac Compiler

eclipse 工程 run as maven install ,报错:

ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre1.6.0_05\..\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.

解决方法:
更改项目jre库:
右键工程-Build Path-Configure Build Path:



System Liabrary 改为:



若Alternate JRE 下拉无jdk选项,需点击Install JREs...手动添加本地jdk



选择本地jdk安装路径



处理后,重新运行 maven install :
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.999 s
[INFO] Finished at: 2017-07-15T12:17:52+08:00
[INFO] Final Memory: 32M/193M
[INFO] ------------------------------------------------------------------------



你可能感兴趣的:(java,eclipse,maven)