分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

【maven】maven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

发布时间:2023-09-06 01:15责任编辑:熊小新关键词:暂无标签

打包过程中报错如下:

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

[INFO] Scanning for projects...[INFO] [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1[INFO] ????????????????????????????????????????????????????????????????????????[INFO] ------------------------------------------------------------------------[INFO] Building firstSpringBootExample 0.0.1-SNAPSHOT[INFO] ------------------------------------------------------------------------[INFO] [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ firstSpringBootExample ---[INFO] Deleting D:\workspace2\firstSpringBootExample\target[INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ firstSpringBootExample ---[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.[INFO] Copying 0 resource[INFO] Copying 0 resource[INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ firstSpringBootExample ---[INFO] Changes detected - recompiling the module![INFO] Compiling 1 source file to D:\workspace2\firstSpringBootExample\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.398 s[INFO] Finished at: 2017-10-01T17:41:26+08:00[INFO] Final Memory: 13M/232M[INFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project firstSpringBootExample: 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
View Code

问题原因:

在IDE上运行项目是使用的jre,但是maven打包项目需要使用JDK

问题解决:

Window --->preferences  --->java   --->Installed JREs ---->Add一个JDK进来

然后在打包的过程中:应用JDK进行maven打包即可。

具体打包过程请详见:http://www.cnblogs.com/sxdcgaq8080/p/7617547.html

【maven】maven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

原文地址:http://www.cnblogs.com/sxdcgaq8080/p/7617542.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved