eclipse 报异常:The specified JRE installation does not exist 的原因和解决的方法

1. 检查jdk的安装时否正确

在CMD命令行里面运行javajavacjava -version 看看是否报错,如果没有则排除安装错误的问题.
这里写图片描述这里写图片描述这里写图片描述
我的JDK安装是没问题的,如果报出 ‘xxx’ 不是内部或外部命令,也不是可运行的程序或批处理文件。,这个就是JDK安装的时候环境没配置好,自己去百度找JDK配置 。

2. 异常的中文意思

异常的中文意思是:指定的JRE安装不存在。为什么是JRE不是JDK呢?,因为JDK里面不是有一个JRE?对这个有疑问的,可以百度一下JDK和JRE、JVM的区别。

3. 前面排除了安装错误的原因

那么就剩下eclipse配置JDK、Tomcat配置、项目本身JDK的导入、以及Maven的Debug Configurations(Maven项目特有的)的问题了、我遇到的就是Debug Configurations,改正之后就好了

4. eclipse配置JDK

路径:Window ====> preferences ====> Java ====> Installed JREs
这里写图片描述
如果JDK报错,就把jdk移除,再次添加就可以。再检查一下,JDK版本对不对应。

5. Timcat 配置的JDK

路径:Window ====> preferences ====> Server ====> Runtime Environments 选定JDK 点击Edit… JRE
这里写图片描述
如果JDK报错,就把jdk移除,再次添加就可以。再检查一下,JDK版本对不对应。

6. 项目本身JDK的导入

路径:项目右键 ====> preferences ====> Java Build Path ====> Libraries
这里写图片描述
如果JDK报错,就把jdk移除,再次添加就可以。再检查一下,JDK版本对不对应。

7. Maven的Debug Configurations(Maven项目特有的)的问题

路径:项目右键 ====> Debug As ====> Debug Configurations ====> JRE
这里写图片描述
如果JDK报错,就把jdk移除,再次添加就可以。再检查一下,JDK版本对不对应。

8 当Maven项目不进断点时

项目右键 ====> Debug As ====> Debug Configurations ====> 右边选择Source选项卡,有Default就删除掉,如====>Add…====> java project ====> 项目名称 ====> OK

The "The specified JRE installation does not exist" exception typically occurs when there is a mismatch between the Java Runtime Environment (JRE) configuration in your project and the actual JRE installation on your system. Here are a few possible reasons and solutions for this issue: 1. Incorrect JRE configuration in Eclipse: - Open the project properties in Eclipse by right-clicking on the project and selecting "Properties". - Go to "Java Build Path" and check the "Libraries" tab. - Ensure that the correct JRE is selected. If not, click on "Add Library" and select the appropriate JRE. - Clean and rebuild your project. 2. Incorrect JRE configuration in Tomcat: - Open the Tomcat server configuration in Eclipse by double-clicking on the server in the "Servers" view. - Go to the "Java" tab and check the "JRE" section. - Ensure that the correct JRE is selected. If not, click on "Installed JREs" and add the appropriate JRE. - Restart the Tomcat server. 3. Multiple JRE installations: - Check if you have multiple JRE installations on your system. - Make sure that the JRE you are using for your project is the same as the one you have installed and configured in Eclipse and Tomcat. 4. Environment variables: - Check if the JAVA_HOME environment variable is set correctly. - Ensure that the PATH environment variable includes the bin directory of the JRE installation. 5. Reinstalling JRE: - If none of the above solutions work, try reinstalling the JRE and make sure to configure it correctly in Eclipse and Tomcat.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值