IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

时间:2024-03-23 20:09:14

mvn打包的时候报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

百度了一下,有几种原因,最终发现,我的报错有两个原因:

1.language level要与jdk版本不一致

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

2.maven配置有错

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

应该选择正确的jdk的路径

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

 

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE

修改D:\Maven\apache-maven-3.6.1\bin\mvn.cmd,这个文件

在第一行添加:set JAVA_HOME=D:\JDK1.8\installation

IDEA mvn package:No compiler is provided in this environment. Perhaps you are running on a JRE