一尘不染

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

java

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

阅读 796

收藏
2020-03-05

共1个答案

一尘不染

  1. 在Eclipse IDE上,进入窗口 > 首选项 > Java > 已安装的JRE >并检查已安装的JRE。你应该在那里有一个JDK条目。
  2. 选择执行环境,如下所示。点击确定
  3. 然后右键单击你的项目-> Maven- > 更新项目

另外,你可能必须更改Maven JRE(请参阅@ jlars62答案),如下所示。转到运行->运行配置,选择我正在运行的Maven Build(从左侧面板中)。然后,单击“ JRE”选项卡,然后选择“工作区默认JRE”选项

2020-03-05