运行run as—>maven install时出现以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project ssh: Compilation failure
Unable to locate the Javac Compiler in:
D:/Program Files/MyEclipse 6.0/jre/../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.
********************************************
更加奇怪的是并不是每次运行都出现,偶尔可以运行成功,生成war包。
网上针对此问题的解决办法大都是:
1)设置JAVA_HOME环境变量为:C:/Program Files/Java/jdk 1.6.0/lib/tools.jar
2)在MyEclipse中设置:
<1>Java -> Build Path -> Classpath Variables ->
JAVA_HOME
C:/Program Files/Java/jdk 1.6.0/lib/tools.jar
<2>Activate only (or add) module
Java -> Installed JREs ->
jdk 1.6.0
C:/Program Files/Java/jdk 1.6.0
D:/Development/Java/jdk1.5.0_16/bin/javaw.exe