打包不成功
[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
同学你好,报错提示是指:此环境中不提供编译器。也许是在JRE上运行,而不是JDK?
Eclipse默认在jre上运行,打包编译需要jdk中的编译器,而jre中并没有。建议同学点击window->preference,选择Java->Installed JREs,如:
点击Add,在出现的页面选择Standrad VM,点击Next,出现上图中Add JRE界面,点击Directory,选择JDK所在的目录,点击Finish,在Installed JREs界面中,在新添加的JDK前打上勾。点击Apply and close。重新打包再试试。
如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星