Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Could not create the Java Virtual Machine

Tags:

java

netbeans

I have visited all existing questions which are related to my question but I still have a problem. All installations are correctly installed. I am using the newest Netbeans version. After executing program I have this error:

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.

And my Netbeans.conf is:

# ${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.

What do I have to do? I've been trying to resolve this error all day. My system Memory is 3Gb.

like image 718
Ahmed Avatar asked Oct 09 '12 21:10

Ahmed


People also ask

What does error could not create Java Virtual Machine mean?

The most common cause for the “Could not create the Java Virtual Machine” error is that Java doesn't have enough available memory on your system to launch the VM client.

How do you fix JVM could not be started?

"The JVM could not be started. The maximum heap size (-Xmx) might be too large or an antivirus or firewall tool could block the execution". If you get this error, first, make sure your antivirus software or firewall is not blocking the execution of ReadyAPI, then do the following: 1.


2 Answers

Could not reserve enough space for object heap

This almost always means that your -Xmx is too high for the machine. There is a message above:

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

Try to provide explicit value, start small. Note that -Xms must be less then or equal to -Xmx

like image 182
Miserable Variable Avatar answered Oct 13 '22 12:10

Miserable Variable


I got the same error while starting Netbeans

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I try to restart Netbeans many times. Same error was repeating. Later I found it was happening as some other application is already using JVM. So I looked for such an application which was Tomcat Server. I terminated Tomcat and tried starting Netbeans again and it was fine. So try looking for any application that uses JVM.

like image 26
Prashanth Shyamprasad Avatar answered Oct 13 '22 13:10

Prashanth Shyamprasad