6 月,1 周
Questions & Answers
25
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project wovv-target: Compilation failure
Unable to locate the Javac Compiler in:
C:\Program Files\Java\jdk1.8.0_131\..\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.
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
# 1 楼答案
Maven试图在错误的目录中找到javac,首先检查JAVA_HOME系统变量。建议我在系统上安装maven,并配置NetBeans以使用它,而不是捆绑maven
之后,通过mvn-v命令检查maven的安装
另外,如果你使用cmd标准win控制台替换$to%,我使用的是bash
还要让NetBeans像这样使用系统安装的maven: