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
同学你好,根据贴出的报错信息: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安装目录,添加应用。
然后,右键项目build path,将刚才配置的JDK添加到项目中
如上修改后,再来尝试一下。
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧