Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine

后端 未结 8 1891
轻奢々
轻奢々 2020-12-25 09:04

I am facing this problem since more than a month, here is what I see when I run java on command line:

$ java -Xmx1300m 
Error occurred during initialization          


        
相关标签:
8条回答
  • 2020-12-25 09:41

    This might also occur if you are running on 64-bit Machine with 32-bit JVM (JDK), switch it to 64-bit JVM. Check your (Right Click on My Computer --> Properties) Control Panel\System and Security\System --> Advanced System Settings -->Advanced Tab--> Environment Variables --> JAVA_HOME...

    0 讨论(0)
  • 2020-12-25 09:42

    Anyway, here is how to fix it:

    Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New:

    Variable name: _JAVA_OPTIONS

    Variable value: -Xmx512M

    taken from this link

    0 讨论(0)
  • 2020-12-25 09:43

    If your computer is a 64bit, all you need to do is uninstall your Java x86 version and install a 64bit version. I had the same problem and this worked. Nothing further needs to be done.

    0 讨论(0)
  • 2020-12-25 09:45

    I've just seen this problem myself, Jboss AS7 with jdk1.5.0_09. Update System Property JAVA_HOME to jdk1.7+ to fix (I'm using jdk1.7.0_67).

    0 讨论(0)
  • 2020-12-25 09:50

    you can do update the User path as inside _JAVA_OPTIONS : -Xmx512M Path : C:\Program Files (x86)\Java\jdk1.8.0_231\bin;C:\Program Files(x86)\Java\jdk1.8.0_231\jre\bin for now it is working / /

    0 讨论(0)
  • 2020-12-25 09:50

    Sometimes it may happen that you run multiple applications on the same java VM. In Case you have tried all the other solutions described above and it didnt work. Try Running your process by running it on a newly created java VM by passing vmargs

    -agentlib:jdwp=transport=dt_socket,server=y,address=10049,suspend=n . 
    

    Here address is what the vm takes.

    0 讨论(0)
提交回复
热议问题