打包不成功

打包不成功

[INFO] Scanning for projects...

[INFO] 

[INFO] ------------------------< com.zqq: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:\eclipse-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.558 s

[INFO] Finished at: 2019-12-17T15:23:51+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回答
好帮手慕阿满 2019-12-17 16:50:35

同学你好,报错提示是指:此环境中不提供编译器。也许是在JRE上运行,而不是JDK?

Eclipse默认在jre上运行,打包编译需要jdk中的编译器,而jre中并没有。建议同学点击window->preference,选择Java->Installed JREs,如:

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

点击Add,在出现的页面选择Standrad VM,点击Next,出现上图中Add JRE界面,点击Directory,选择JDK所在的目录,点击Finish,在Installed JREs界面中,在新添加的JDK前打上勾。点击Apply and close。重新打包再试试。

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

  • 提问者 董先生啊 #1
    安装过JDK
    2019-12-17 17:08:39
  • 好帮手慕阿满 回复 提问者 董先生啊 #2
    同学你好,这里是建议在Installed JREs界面下,添加JDK的路径,报存后重新打包再试试。问一下同学有按照上面的操作执行吗?是否还有报错,报错是什么呢?祝:学习愉快~
    2019-12-17 18:40:33
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

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