maven打包报错

maven打包报错

[INFO] Scanning for projects...

[INFO] 

[INFO] -----------------------< com.imooc:maven-first >------------------------

[INFO] Building maven-first 1.0.0-RELEASE

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

[INFO] 

[INFO] >>> maven-assembly-plugin:2.5.5:assembly (default-cli) > package @ maven-first >>>

[INFO] 

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

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

[INFO] Copying 0 resource

[INFO] 

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

[INFO] Changes detected - recompiling the module!

[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

[INFO] Compiling 1 source file to D:\JAVA\workspace\maven-first\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:  1.710 s

[INFO] Finished at: 2020-03-24T10:52:00+08:00

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

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


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小班 2020-03-24 15:04:03

同学你好,根据贴出的报错信息:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?-->在这个环境中没有提供编译器。也就是说并没有配置jdk目录。

同学可以参考如下配置:

        进入 Window > Preferences > Java > Installed JREs ->Add ->Standard VM     选择jdk安装目录,添加应用。

http://img1.sycdn.imooc.com//climg/5e79b03c0944a88f10470540.jpg

然后,右键项目build path,将刚才配置的JDK添加到项目中

http://img1.sycdn.imooc.com//climg/5e79b0d20999ed5c10650431.jpg

http://img1.sycdn.imooc.com//climg/5e79b0d70955bcd307760414.jpg

如上修改后,再来尝试一下。

如果我的回答解决了你的疑惑,请采纳,祝学习愉快~

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星

相似问题

登录后可查看更多问答,登录/注册

请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码