Maven install 时出现Unable to locate the Javac Compiler 解决办法
问题描述:
在使用eclipse 运行 maven install的时候,出现以下错误:
[ERROR] Unable to locate the Javac Compiler in:
D:\Program Files\Java\jre6\..\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.
解决方法:
1.在eclipse.ini文件中加了两行(一定要加在-vmargs之前,而且-vm后面有回车):
-vm
C:/Program Files/Java/jdk1.8.0_121/jre/bin/javaw.exe
3.选择目录树中的"Execution Environments", 点选界面左侧的"J2SE-1.5",然后在右侧点选"jdk1.5.0_16"。