Maven Install报错:Perhaps you are running on a JRE rather than a JDK?

Posted wjx6270

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Maven Install报错:Perhaps you are running on a JRE rather than a JDK?相关的知识,希望对你有一定的参考价值。

英文描述:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project busiservice: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

中文描述:此环境中未提供编译器,你可能使用jre运行而不是jdk。
引发原因:Eclipse默认在jre上运行,maven install 编译需要jdk中的编译器,而jre中并没有

问题解决:

 1,window>>preference>>java>>installJRes  添加jdk安装路径,并勾选
2,window>>preference>>java>>installJRes >>excutionEnvironments:选择当前用的Java版本,右边勾选刚添加的jdk。
技术图片
 
 

以上是关于Maven Install报错:Perhaps you are running on a JRE rather than a JDK?的主要内容,如果未能解决你的问题,请参考以下文章

mavenmaven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE(代

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? ide

maven 执行mvn install 命令报错

maven install 构建报错

Maven项目出现Perhaps you are running on a JRE rather than a JDK?

idea maven install 卡住,无报错排查。