NetBeans 啟動報錯 JVM creation failed解決
阿新 • • 發佈:2019-01-22
前幾天安裝NetBeans後還曾用過,今天啟動時卻報了JVM creation failed,很明顯,是java虛擬機器載入失敗,暫且這麼描述吧,應該是與什麼配置有關係。
嘗試多次後找到原因:
NetBeans安裝目錄的etc下netbeans.conf檔案中,
# ${HOME} will be replaced by JVM user.home system property netbeans_default_userdir="${HOME}/.netbeans/7.0" # 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-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) explicitly, 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/FaqGCPauses) # Default location of JDK, can be overridden by using --jdkhome <dir>: netbeans_jdkhome="c:\Program Files\Java\jdk1.7.0_02" # 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_options 有一個-J-XX:MaxPermSize=384m 的,
經幾次嘗試,修改成300也不可以,最後修改成256後啟動成功。大概問題就是因為最大值過大,稍調整小一點就可以了。