您的位置:首页 > 编程语言 > Java开发

NetBeans 启动失败,提示“JVM creation failed”的解决办法

2012-01-06 08:41 405 查看
 
前些日子一直正常运行的NetBeans 7.0今天突然启动报错了,提示“JVM creation failed”。在网上查找了一下也没有找到解决的办法,看来只有自己动手了。
    从提示上看,是因为启动Java虚拟机失败了,应该是因为配置的问题引起的。在NetBeans的安装目录下有一个etc文件夹,下面有一个netbeans.conf文件,这个文件就是NetBeans的启动配置文件,打开文件内容如下:

# ${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就可以了。

    另外,也可以直接在这一行前面加上一个“#”,将该行注消。

 

    Eclipse启动失败时,也可以在其安装目录下找到一个eclipse.ini文件,将其删除即可解决。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐