当前位置: 首页 > 知识库问答 >
问题:

此环境中不提供编译器。也许您运行的是JRE而不是JDK?

谢嘉
2023-03-14

我正在使用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?

共有1个答案

厉钊
2023-03-14
  1. 在Eclipse IDE上,进入Windows>Preferences>Java>Installed JREs>并检查已安装的JREs。您应该有一个带有JDK的条目。
  2. 按如下所示选择执行环境。单击“确定”
  3. 然后右键单击项目->Maven->Update Project

此外,您可能必须更改Maven JRE(参见@jlars62答案),如下所示。Goto Run->Run Configurations,选择我正在运行的Maven构建(从左侧面板)。然后,单击JRE选项卡并选择Workspace default JRE选项

 类似资料: