运行eclipse出现no java virtual machine was found

时间:2022-06-06 23:09:02

出现此问题的原因是eclipse找不到javaw.exe的path,打开eclipse.ini文件:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m


在openFile和--launcher.appendVmargs之间添加:

-vm
C:\Program Files\Java\jdk1.8.0_31\bin\javaw.exe

即添加javaw.exe的位置。