一聚教程网:一个值得你收藏的教程网站

热门教程

解决Eclipse:Failed to create the Java Virtual Machine

时间:2022-06-29 02:38:19 编辑:袖梨 来源:一聚教程网


我在用Eclipse的最新版Java EE Kepler(v4.3.0),安装完JBoss Developer Studio 7(Kepler)后,再次启动Eclipse,弹出Failed to create the Java Virtual Machine的错误。确认后就会自动退出。

原因分析:

安装完JBoss Developer Studio 7(Kepler)后,对Eclipse安装目录下的eclipse.ini文件重新写入新的参数导致。

源文件:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20130521-0416
-product
org.eclipse.epp.package.jee.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

修改后:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20130521-0416
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms256m
-Xmx1024m
-Djboss.discovery.directory.url=https://devstudio.jboss.com/updates/7.0/devstudio-directory.xml

可以看到,-Xms和-Xmx的参数被改大了,启动时系统不能为其分配足够的内存导致这个错误的出现。

解决方法:

-Xms不变,将-Xmx的参数修改为512m即可。

热门栏目