当我从eclipse运行maven install时,我收到以下错误。 我在已安装的JRE中有JRE6
窗口 - 首选项 - Java - 已安装的JRE
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile)
.....
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
C:\Program Files\Java\jre6\..\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.
我在环境变量中正确设置了JAVA_HOME - C:\ Program Files \ Java \ jdk1.6.0_45,从命令提示符执行java -version时可以看到相同的内容
答案 0 :(得分:2)
如错误所示,它无法找到Javac编译器。 JRE没有编译器。你需要JDK。
在Window - preferences - Java - 安装的JRE中,添加JDK / jre ..
说C:\ Program Files \ Java \ jdk1.6.0_45 \ jre