運行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