【发布时间】:2014-06-25 13:10:53
【问题描述】:
我遇到了这个问题。我看到很多这样的帖子,但我仍然无法解决这个问题。当我将 mvn release:prepare 放在 shell 时出现此错误
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3:compile (default-compile) on project birthday-greeting-card-sender: Compilation failure
[INFO] [ERROR] Unable to locate the Javac Compiler in:
[INFO] [ERROR] /usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/tools.jar
[INFO] [ERROR] Please ensure you are using JDK 1.4 or above and
[INFO] [ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[INFO] [ERROR] In most cases you can change the location of your Java
[INFO] [ERROR] installation by setting the JAVA_HOME environment variable.
[INFO] [ERROR] -> [Help 1]
[INFO] [ERROR]
[INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[INFO] [ERROR]
[INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
我已将 JDK 设置为 /usr/lib/jvm/java-7-openjdk-amd64(Preferences-->Java-->Installed JRE)。我也将这一行添加到 eclipse.ini 中,但它也无法工作:
-vm /usr/lib/jvm/java-7-openjdk-amd64
有人知道发生了什么吗?
【问题讨论】:
-
你的 $JAVA_HOME 是什么?
标签: java maven compiler-construction release