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
答案 0 :(得分:0)
Maven试图在错误的目录中找到javac,首先检查你的JAVA_HOME系统变量。我建议在系统上安装maven并配置NetBeans以使用它来代替捆绑的maven。
echo $JAVA_HOME
C:\Progra~1\Java\jdk1.8.0_131
之后通过mvn -v命令检查maven安装
mvn -v
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T22:39:06+03:00)
Maven home: C:\Program Files\apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: C:\Progra~1\Java\jdk1.8.0_131\jre
Default locale: ru_RU, platform encoding: Cp1251
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
PS。我正在使用bash,如果你使用cmd标准win控制台替换$ to%like
echo %JAVA_HOME%
也让NetBeans使用你的系统安装maven: