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的安装路径就可以了,操作如图:
推荐阅读
-
Visual Studio 2017创建.net standard类库编译出错原因及解决方法
-
Android笔记之:App自动化之使用Ant编译项目多渠道打包的使用详解
-
Spring Boot Maven 打包可执行Jar文件的实现方法
-
详解React项目如何修改打包地址(编译输出文件地址)
-
GD 编译出错解决方法
-
Android 编译出错版本匹配问题解决办法
-
maven 打包时间戳问题
-
详解SpringBoot获得Maven-pom中版本号和编译时间戳
-
解决Maven 编译出的jar中没有主清单属性
-
Visual Studio 2017创建.net standard类库编译出错原因及解决方法