eclipse方法見 "Eclipse 3.6 jee failed to create the java virtual machine"
Netbeans的方法
我的環境 WinXP+NetBeans7.0。
前些日子一直正常啟動並執行NetBeans 7.0今天突然啟動報錯了,提示“JVM creation failed”。
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/7.0beta"
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m-J-XX:MaxPermSize=384m-J-Dnetbeans.logger.console=true
-J-ea -J-Dapple.laf.useScreenMenuBar=true
-J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
# Note that a default -Xmx is selected for you automatically.
# You can find this value in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx here
# or on the command line.
# If you specify the heap size (-Xmx) explicitely, you may also want to enable
# Concurrent Mark & Sweep garbage collector. In such case add the following
# options to the netbeans_default_options:
# -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled
# (see http://wiki.netbeans.org/wiki/view/FaqGCPauses)
# Default location of JDK, can be overridden by using --jdkhome <dir>:
netbeans_jdkhome="D:\Java\jdk1.6.0_16"
# Additional module clusters, using ${path.separator} (';' on Windows or ':' on Unix):
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"
# If you have some problems with detect of proxy settings, you may want to enable
# detect the proxy settings provided by JDK5 or higher.
# In such case add -J-Djava.net.useSystemProxies=true to the netbeans_default_options.
該設定檔中以“#”開頭的行均為注釋,因此重點關注未以“#”開頭的行。
第一行“netbeans_default_userdir”,定義了使用者關於NetBeans的設定儲存的位置。(這裡應該不會影響。)
第二行“netbeans_default_options”,這後面的參數包括了Java虛擬機器啟動時的一些設定以及NetBeans啟動時的一些設定。(問題應該就在這裡了。)
第三行“netbeans_jdkhome”,這裡定義了NetBeans所使用的JDK所在的位置。(這裡應該也不會影響。)
在“netbeans_default_options”後的參數中,有一條“-J-MaxPermSize=384m”,這裡定義了Java虛擬機器能使用的堆棧的最大值為384m,最後經過多次修改嘗試,將其值改為300m就可以了。
另外,也可以直接在這一行前面加上一個“#”,將該行注消。