Eclipse中...No java virtual machine was found...解决方法

时间:2022-06-06 23:08:38

打开Eclipse时,出现了一个错误:...No java virtual machine was found...

完整的错误提示是:A java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:

D:\Run\eclipse\jre\bin\javaw.exe

javaw.exe in your current PATH

如下图所示:

Eclipse中...No java virtual machine was found...解决方法

错误的意思是:在指定的路径D:\Run\eclipse\jre\bin\javaw.exe下面没有找到javaw.exe。原因是Eclipse启动的时候需要javaw.exe来启动,启动Eclipse时,程序会先查询系统变量PATH,若无;则在Eclipse的安装目录(如D:\Run\eclipse\)中查询,若还是没有查询到,则会出现上面的错误提示。

解决办法有两个:

(1)修改eclipse.ini配置文件,打开eclipse.ini在文件的最前面加入两行内容:

-vm

D:/Run/java/jdk1.8.0_91/bin/javaw.exe

这是javaw.exe的完整路径。也可以是jre目录下的bin/javaw.exe

(2)在系统环境变量PATH中,添加javaw.exe的路径,例如:

D:/Run/java/jdk1.8.0_91/bin;或者是D:/Run/java/jre1.8.0_91/bin;


原文地址:http://www.mafutian.net/123.html