gpt4 book ai didi

java - Maven 无法定位 Javac 编译器 - 无法在 : 中定位 Javac 编译器

转载 作者:搜寻专家 更新时间:2023-10-31 08:12:22 31 4
gpt4 key购买 nike

当我尝试在我的 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.....

最佳答案

如果是 JDK,看起来您的 JAVA_HOME 可能指向 JRE?

C:\Development\java jre7\..\lib\tools.jar

你有安装JDK吗?如果是这样,请将您的 JAVA_HOME 更改为指向 JDK。如果没有,请先下载JDK,然后设置JAVA_HOME。

更新

因为您是从 Eclipse 内部运行的,所以您的答案在 SO 上- 您需要告诉 Eclipse 使用 JDK 而不是 JRE。

关于java - Maven 无法定位 Javac 编译器 - 无法在 : 中定位 Javac 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14173644/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com