Maven无法找到Javac编译器 - 无法找到Javac编译器:

use*_*812 5 java maven m2e

当我尝试在我的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
Run Code Online (Sandbox Code Playgroud)

但是JAVA_HOME已经确定了.当我运行cmd "echo %JAVA_HOME%"它说C:\Development\jdk7,这是正确的.不知道为什么他在寻找C:\Development\java jre7......

Pet*_*son 13

看起来你的JAVA_HOME可能指向JRE而不是JDK?

C:\Development\java jre7\..\lib\tools.jar
Run Code Online (Sandbox Code Playgroud)

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

更新

既然你在Eclipse运行你的答案是对SO -你需要告诉Eclipse中使用JDK,而不是JRE.