Failed to create the Java Virtual Machine
由于项目里面用eclipse,今天从eclipse官网下载了一个Eclipse IDE For Java EE Developers,
版本:eclipse-jee-helios-win32
自己电脑上装的jdk版本是:1.6.0_20
解压后启动,发现弹出提示框“ Failed to create the Java Virtual Machine”

解决方法:
找到eclipse目录下的eclipse.ini,可以看到如下内容:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
256m
–launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
修改–launcher.XXMaxPermSize 128
如下:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
–launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.jee.product
–launcher.defaultAction
openFile
–launcher.XXMaxPermSize
128M
-showsplash
org.eclipse.platform
–launcher.XXMaxPermSize
128m
–launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

改了之后确实可以了,这是为什么呢?
对,是呢,改过之后倒是好了,但是什么原因呢?
其实这里有解释的:http://wiki.eclipse.org/Eclipse.ini
我升级新版本后也出错了,修改一下Eclipse.ini,在其中加入
-vm
D:/Java/bin/javaw.exe
保存后,打开Eclipse就正常了.其中D:/Java/bin/javaw.exe是我的Java虚拟机路径.
一般出现这种情况跟安装了多个Java虚拟机有关吧,我自己就安装了1.5与1.6的,所以会出现这个情况.
This is both street smart and intlleigent.
我也是因为有多个虚拟机造成的。指定一个就解决了。
非常感谢啊!
I come across the same problem and have fix it by modifying the ecclipse.ini file. Check the link below for more information.
http://jeeshenlee.wordpress.com/2010/09/24/eclipse-failed-to-create-java-virtual-machine/
Thanks.
Regards,
JeeShenLee
good..thanks…
我也遇到这个问题了,你知道标准配置为什么会出问题么?
可能是电脑内存太低,如果是2G的内存的话肯定没问题。
我3G的内存照样报错,不是内存大小的问题。我把最下面的-xmx512修改成400,384之后就都可以开启,只要大于512就报错