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

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

问题描述

我是 Java 企业开发领域的新手.我组织的 Java 大师无限期休假,我被分配了维护他开发的一些 Java 应用程序的任务.在他离开之前,他在我的电脑上用 Maven 设置了 Eclipse [Kepler SR1],它似乎工作正常.

现在我已准备好部署我的第一个修改并需要运行 Maven install,但我无法让它工作 - 我在控制台上得到以下输出:

<块引用>

[错误] 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project mrpapp: Compilation failure
[错误] 此环境中未提供编译器.也许您在 JRE 而不是 JDK 上运行?

但我绝对运行的是 JDK 而不是 JRE.我仔细检查了我的 $JAVA_HOME(C:Program Files (x86)Javajdk1.7.0_60),它确实有一个javac.exe 在其 bin 目录中.

我附上我的 pom.xml 文件的副本供您查看.我确定那里有什么东西导致了这个问题,但我不确定它可能是什么.我使用的是装有 Windows 7 64 位的笔记本电脑,如果您需要更多平台/环境信息,我也可以提供.

任何帮助将不胜感激.

解决方案

转到窗口 → 首选项 → 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)Javajdk1.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天全站免登陆