当前位置:首页 > 服务端 > maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

[INFO] Scanning for projects...

[WARNING]

[WARNING] Some problems were encountered while building the effective model for com.yusys.pro:NewsManagement:war:0.0.1-SNAPSHOT

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 176, column 23

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING]

[INFO]                                                                        

[INFO] ------------------------------------------------------------------------

[INFO] Building NewsManagement Maven Webapp 0.0.1-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[INFO]

[INFO] >>> jetty-maven-plugin:8.1.16.v20140903:run (default-cli) > test-compile @ NewsManagement >>>

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ NewsManagement ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 5 resources

[INFO]

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ NewsManagement ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 9 source files to D:\worksheet\NewsManagement\target\classes

[INFO] -------------------------------------------------------------

[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: 2.264 s

[INFO] Finished at: 2018-01-13T08:06:00+08:00

[INFO] Final Memory: 9M/153M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project NewsManagement: 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

 这个错误是运行环境的错误,意思是运行时在jre上运行,不是在jdk上运行,故而需要更改运行环境切换在jdk上运行。

解决办法是:window---->preferences选择如下切换

maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? _ JavaClub全栈架构师技术笔记

如果没有添加jdk,则add

maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? _ JavaClub全栈架构师技术笔记

next

maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? _ JavaClub全栈架构师技术笔记

选择jdk的安装包,如下

maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? _ JavaClub全栈架构师技术笔记

然后finish,并勾选第一张图的jdk,点击OK ,运行环境切换完成。

 

作者:醉逍遥_001
来源链接:https://www.cnblogs.com/xiaoyao-001/p/8278322.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/125481.html

标签: No compiler
分享给朋友:

“maven启动报错No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?” 的相关文章