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

问题:

我正在使用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. 在Eclipse IDE中,进入> > > >,然后查看您的。你应该有一个有JDK的条目。
  2. 选择执行环境如下所示。点击
  3. 然后在您的项目 – > – >

此外,您可能需要更改Maven JRE(请参阅@ jlars62答案),如下所示。 Goto Run – >运行配置,选择正在运行的Maven Build(从左侧面板)。然后,我单击了JRE选项卡并选择了工作区默认JRE选项
 enter image description here

 
 
Code问答: http://codewenda.com/topics/python/
Stackoverflow: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

*转载请注明本文链接以及stackoverflow的英文链接

发表评论

电子邮件地址不会被公开。 必填项已用*标注

45 + = 53