这个错误是因为eclipse的Xmx的值设置太大. Eclipse缺省启动配置文件指定了JVM的堆内存的大小小Xmx,.
Xmx的设置在eclipse.ini文件中.如果该值设置太大,而电脑内存中没有连续的这么大内存空间的话,Eclipse就会启动出错._failed to create the java virtual machine
所以解决办法是改动eclipse.ini文件,删除Xmx的设置.这样Eclipse就可以正常启动.
或将Xmx的值改小一些
步骤如下:
- 找到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
- 将其修改为如下内容,即可启动Eclipse
- -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.6
- -Xms40m
- -Xmx256m
其实我也没有用这些繁琐的办法,既然知道是配置文件出的问题,那么就删掉配置文件,重新启动Eclipse,OK!