在此环境中不提供编译器。也许你运行在JRE而不是JDK? [英] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

查看:211
本文介绍了在此环境中不提供编译器。也许你运行在JRE而不是JDK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用m2eclipse在Eclipse中编译一个项目。我在Eclipse中设置JDK路径,如下所示:

  Windows  - >首选项 - >已安装jres  - > jdk1.7.xx路径

但是这显示错误

  [错误]编译错误:
[INFO] ---------------------- ---------------------------------------
[ERROR]不提供编译器在这种环境下。也许你运行在JRE而不是JDK?
[INFO] 1错误
[INFO] ---------------------------------- ---------------------------
[INFO] ---------------- -------------------------------------------------- ------
[INFO] BUILD FAILURE
[INFO] ---------------------------- --------------------------------------------
[信息]总时间:1.424s
[INFO]完成于:Tue Oct 29 15:21:01 IST 2013
[INFO] Final Memory:5M / 15M
[INFO] ---- -------------------------------------------------- ------------------
[ERROR]无法执行目标org.apache.maven.plugins:maven-compiler- plugin:3.1:compile(default-compile )项目TEST-WEB:编译失败
[ERROR]在此环境中没有提供编译器。也许你运行在JRE而不是JDK?


解决方案


  1. ,请进入 窗口 > 首选项 > Java > 安装的JRE >,并检查您的 安装的JRE 。你应该有一个有JDK的条目。

  2. 选择执行环境如下所示。点击 确定

  3. 然后在您的项目上点击 更新项目

此外,您可能需要更改Maven JRE(请参阅@ jlars62答案),如下所示。转到运行 - >运行配置,选择正在运行的Maven构建(从左侧面板)。然后,我点击了JRE选项卡并选择了工作区默认JRE




I'm compiling a project in Eclipse using m2eclipse. I set the JDK path in Eclipse like this:

Windows-->preferences-->installed jres--> jdk1.7.xx  path

But this is showing an error

[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. On your Eclipse IDE, go into Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there.
  2. Select the Execution Env as show below. Click OK
  3. Then Right-Click on your Project -> Maven -> Update Project

Additionally, you may have to change Maven JRE (see @jlars62 answer) which is as follows. Goto Run -> Run Configurations, selecting the Maven Build I was running (from the left panel). Then, I clicked the JRE tab and selected the option Workspace default JRE

这篇关于在此环境中不提供编译器。也许你运行在JRE而不是JDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆