Maven MojoExecutionException 异常

新手上路,请多包涵

我正面临这个问题,当我使用 Maven 部署我的应用程序时,请提出一些解决方案。

错误日志,

 [INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.790s
[INFO] Finished at: Wed Apr 23 10:44:13 IST 2014
[INFO] Final Memory: 54M/131M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project clustering.services: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre7\..\lib\tools.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :clustering.services

提前致谢。

原文由 astack 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2k
2 个回答

JAVA_HOME 设置为 jdk 而不是 JDK_DIR/jre ,请参阅 问题了解如何设置该值

原文由 jmj 发布,翻译遵循 CC BY-SA 3.0 许可协议

如果您使用的是 Eclipse,请转至 Windows->Preferences。在 Java->Installed JREs 下,双击列表中的项目并确保 JRE home 指向 JDK(例如,将其设置为“C:\Program Files\Java\jdk1.7.0_60”),然后离开其他一切都一样。

原文由 Alex 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题