Failed to create the Java Virtual Machine" 解決方案

 

以前用的eclipse-jee因爲在部署項目過程中總是出現bug被我刪除。今天去eclipse官網又下了一個Eclipse IDE For Java EE Developers。

版本是:eclipse-jee-helios-SR1-win32.zip

我的jdk版本是:1.6.0_20

解壓後啓動,發現彈出提示框“ Failed to create the Java Virtual Machine”


針對這個問題在網上尋找解決方案。找到幾個,全是Ctrl c/v,不帶半句解釋。

後來,靠着差強人意的有限英語水平,在eclipse官網的論壇搜索,發現此問題是一bug。

“The Java bug was closed for voting and comments at 6969236 on the Java BugParade because the change has been reverted; the related Eclipse bug report is open for oting and comments at bug 319514. ”-引用eclipse官網

在修復版本推出之前它提供了一個解決方法:

打開eclipse目錄下的eclipse.ini文件,修改–launcher.XXMaxPermSize屬性,其中此屬性有兩處

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-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

將其值改爲128m即可,如下。(事實上,只改後面一個就可以,啓動eclipse時以後者爲準)

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-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

然後就可以成功啓動。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章