我正在执行代码,出现错误“找不到Javac编译器”
Maven试图在错误的目录中找到javac,首先检查JAVA_HOME系统变量。建议我在系统上安装maven,并配置NetBeans以使用它,而不是捆绑maven我正在执行代码,出现错误“找不到Javac编译器”,java,Java,Maven试图在错误的目录中找到javac,首先检查JAVA_HOME系统变量。建议我在系统上安装maven,并配置NetBeans以使用它,而不是捆绑maven 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 J
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
之后,通过mvn-v命令检查maven的安装
echo $JAVA_HOME
C:\Progra~1\Java\jdk1.8.0_131
另外,如果您使用cmd标准win控制台替换$to%,我将使用bash
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"
还要让NetBeans像这样使用系统安装的maven:
看起来你没有安装javac。您是否尝试过安装它?请阅读此文章,以提供足够的具体信息来描述您的问题,从而改进您的问题。
echo %JAVA_HOME%