场景

将SpringBoot打包时提示:

Perhaps you are running on a JRE rather than a JDK?

解决

Eclipse默认在jre上运行,maven install 编译需要jdk中的编译器,而jre中并没有

找到Windows-preferences-java-Installed JREs-Add-Standard VM--next

SpringBoot打包时提示:Perhaps you are running on a JRE rather than a JDK?_编译器

选择jdk的安装目录,点击Finish,此为默认安装目录。

SpringBoot打包时提示:Perhaps you are running on a JRE rather than a JDK?_java_02

添加完后,勾选为刚才添加的jdk

SpringBoot打包时提示:Perhaps you are running on a JRE rather than a JDK?_maven打包_03

然后再选择Installed IREs下的Execution Environments,重新设置为jdk,然后关闭。

SpringBoot打包时提示:Perhaps you are running on a JRE rather than a JDK?_maven打包_04