欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Maven打包编译出错

程序员文章站 2022-06-13 19:05:12
...

错误内容节选

[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.436 s
[INFO] Finished at: 2017-06-28T11:16:07+08:00
[INFO] Final Memory: 10M/151M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project manage: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
遇到错误不要慌,英语不好的同志先百度翻译走一波,错误倒数第二和第三行是重点,大意如下:
无法**请求的配置文件“pom.xml”,因为它不存在。
此环境中不提供编译器。也许您运行的是JRE而不是JDK?
这就很明显了嘛,你的项目用的不是jdk,而是jre,打开eclipse>Window(窗口)>Perferences(首选项)>Java>Installed JREs,这时看表格的Location就是你的jre的路径,而不是jdk的安装路径,改成jdk的安装路径就可以了,操作如图:

Maven打包编译出错