首页 > 其他 > 详细

maven项目bulid失败_No compiler is provided in this environment.

时间:2019-08-27 00:40:29      阅读:96      评论:0      收藏:0      [点我收藏+]

 错误信息如下:

[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.103 s
[INFO] Finished at: 2019-08-26T17:41:36+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project springmvc: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [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/MojoFailureException

 

前提:maven项目,tomcat 7,jdk1.8

根据错误信息提示:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?这个环境中没有提供编译器。也许您运行的是JRE而不是JDK?

1:首先查看 Eclipse-->Window-->preferences-->Java-->Installed JREs
果然java编译环境是jre,而maven项目的运行需要指定一个符合配置的JDK环境,所以我们配置一个jdk目录,并且指定为jdk目录,同时为了防止出错,我把jre目录删除掉了

技术分享图片


2:项目右键-->build path-->configure build path-->java Build Path-->接着图片操作

技术分享图片


3.项目右键-->run as -->run configurations..--> jre -->execution environment选择刚刚配置的jdk-->run

技术分享图片

 

 重新编译运行即可!

 

maven项目bulid失败_No compiler is provided in this environment.

原文:https://www.cnblogs.com/sunchunmei/p/11414346.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!