java - 错误 : Could not create the Java Virtual Machine

标签 java netbeans

我已经访问了所有与我的问题相关的现有问题,但我仍然有问题。所有安装均已正确安装。我正在使用最新的 Netbeans 版本。执行程序后出现此错误:

Error: Could not create the Java Virtual Machine.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: A fatal exception has occurred. Program will exit.

我的 Netbeans.conf 是:

# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/7.1.2"
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms16m -J-XX:PermSize=16m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true"
# Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.
# You can find these values in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx or
# -J-XX:MaxPermSize= 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:\Arquivos de programas\Java\jdk1.7.0_07"
# 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.

我需要做什么?我一整天都在尝试解决这个错误。我的系统内存是 3Gb。

最佳答案

Could not reserve enough space for object heap

这几乎总是意味着您的 -Xmx 对于机器来说太高了。上面有留言:

# Note that default -Xmx and -XX:MaxPermSize are selected for you automatically

尝试提供明确的值(value),从小做起。请注意,-Xms 必须小于或等于 -Xmx

关于java - 错误 : Could not create the Java Virtual Machine,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12808752/

相关文章:

java - 使用 Lucene 进行分词和索引,如何处理外部分词和词性?

java - 概念 : Build Java Program and load it into Oracle DB - Wrapper function calls java function with return

java - 当队列已满时增加数组大小的入队方法

c++ - 集成 Qt 框架、Netbeans IDE、Visual Studio C++ 编译器

java - 使用JOOQ,我还需要什么来防止sql注入(inject)

java - 我该怎么做才能使我的 android Activity 设计更像这个应用程序屏幕截图图像?

java - 如何在 netbeans 项目的文件夹中添加库

java - 如何停止 Netbeans 中正在运行的进程

java - 如何阻止 Netbeans IDE 8.1 插入额外的反斜杠 "\"?

angularjs - 如何将自定义 AngularJS 指令添加到 Netbeans 7.4 IDE 中的 html 验证器?