我正在使用 m2eclipse 在 Eclipse 中编译项目。我在 Eclipse 中设置 JDK 路径,如下所示:
Windows-->preferences-->installed jres--> jdk1.7.xx path
但这显示了一个错误
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.424s
[INFO] Finished at: Tue Oct 29 15:21:01 IST 2013
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler- plugin:3.1:compile (default-compile) on project TEST-WEB: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
对我来说,这正是日食专家的抱怨
因此,我按 “ Edit
按钮,将路径更改为 “JDK 文件夹”,然后清理项目,一切开始工作
JAVA_HOME
环境变量设置为 JDK 根文件夹 - 如果运行命令行或 maven(mvn), mvn
JAVA_HOME
以获取更多信息)