【发布时间】:2012-12-19 20:46:32
【问题描述】:
当我尝试在我的 gwt-maven Projekt 上进行 maven-install 时,我收到此错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project MyProject: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Development\java jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
但JAVA_HOME 已设置。当我运行cmd "echo %JAVA_HOME%" 时,它显示C:\Development\jdk7,这是正确的。
不知道他为什么要搜索C:\Development\java jre7.....
【问题讨论】:
-
你在 mavenrc.bat 中设置了吗?在Windows上更改JAVA_HOME后是否重新启动了cmd exe?
-
没有。我还没有在 mavenrc.bat 中进行设置。不,我没有重新启动,因为 JAVA_HOME 已经设置了......我不知道......很久以前 ^^
-
也许尝试使用更新版本的 maven-compiler-plugin?
-
m2e 的路径名有空格问题,我相信。
-
重新标记为 m2e。如果您使用开发环境信息更新您的问题,这将是更容易和更好的做法。干杯:)