Eclipse / Maven错误:“在此环境中不提供编译器” [英] Eclipse/Maven error: "No compiler is provided in this environment"

查看:627
本文介绍了Eclipse / Maven错误:“在此环境中不提供编译器”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java企业发展世界的一个相对新人。我的组织的Java大师是无休止的家庭假,我被分配了维护他开发的一些Java应用程序的任务。在他离开之前,他在我的电脑上安装了Eclipse [Kepler SR1]和Maven。它似乎运行正常。



现在我准备好部署我的第一个修改和需要运行Maven 安装,但我无法使其正常工作 - 我在控制台上获得以下输出:


[ERROR]无法执行目标org.apache.maven.plugins:maven-compiler-plugin:3.1:在项目中编译(默认编译)mrpapp:编译失败

[ERROR]此环境中不提供编译器。也许你正在运行一个JRE而不是一个JDK?


但是我绝对 am 运行JDK和不是JRE。我仔细检查了我的 $ JAVA_HOME C:\Program Files(x86)\Java\jdk1.7.0_60 ),而 bin 目录中有 javac.exe / p>

我附加了我的 pom.xml 文件的副本供您审阅。我确定有一些事情导致了这个问题,但我不知道这可能是什么。我正在使用带有Windows 7 64bit的笔记本电脑,如果您需要任何进一步的平台/环境信息,我也可以提供。



任何帮助将不胜感激。 p>

解决方案

转到窗口→首选项→Java→安装的JRE。



看看是否有一个条目指向您的JDK路径,如果没有,请单击编辑按钮,并将您配置的路径您的 JAVA_HOME 环境。


I am a relative newcomer to the world of Java enterprise development. My organization's Java guru is out on indefinite family leave, and I have been assigned the task of maintaining some of the Java applications he developed. He setup Eclipse [Kepler SR1] with Maven on my computer before he left, and it appeared to work ok.

Now I'm ready to deploy my first modification and need to run a Maven install, but I am having trouble getting it to work - I get the following output on my console:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project mrpapp: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

but I definitely am running a JDK and not a JRE. I double-checked my $JAVA_HOME (C:\Program Files (x86)\Java\jdk1.7.0_60) and it does have a javac.exe in its bin directory.

I am attaching a copy of my pom.xml file for your review. I'm sure there is something in there that is causing the problem, but I am not sure what it might be. I am using a laptop with Windows 7 64bit, if you need any further platform/environment info I can supply that as well.

Any help will be greatly appreciated.

解决方案

Go to Window → Preferences → Java → Installed JREs.

And see if there is an entry pointing to your JDK path, and if not, click on Edit button and put the path you configured your JAVA_HOME environment.

这篇关于Eclipse / Maven错误:“在此环境中不提供编译器”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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