简体   繁体   中英

Java "Error occurred during initialization of VM" fix?

I was trying to make a Minecraft server and got the following error on startup:

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

I tried everything I could find: I created CLASS and CLASSPATH environmental variables that went to my Java's bin folder. I re-installed java, making sure it was 64 bit, as my computer is. Still, I get this error. Does anyone know a solution?

You are attempting to allocate more RAM than your system will allow you to allocate.

In your startup script, lower the values of your Xmx/Xms arguments.

使用-XX:MaxHeapSize=256m (或任何大数字)运行 JVM,可能还有-Xmx512m

I've actually noticed this issue when you try and take a dump of a service running java. Try using psexec -s to execute your dump

I'm not sure why this seems to work on some servers and not others

I had this same error. Running the cmd as Administrator resolved it.

I encountered this error when I was trying to build selenium webdriver. as suggested above by Rogue that we need to reduce the allocated memory in the arguments.

I changed java heap size arguments as below

java $JAVA_OPTS -Xmx256m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=256m -jar third_party/jruby/jruby-complete.jar -X-C -S rake $*

I also faced this issue by My IntellijIDEA allocate more jvm memory space than system allocated. My issued is resolved through just uninstall the JDK and install it again.

It happened to me also. My eclipse would not run. Uninstalled and reinstalled eclipse like 3 time and no luck. Came to this question during a google search, and Yasir's answer helped me out, because I also had IntelliJ installed into my DEV BOX recently. So deleted C:\Program Files\Java folder and reinstalled java into default install folder and it worked. I also had jdk in my system path from previous setup.

重新安装最新版本的 JDK 后,我的问题得到了解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM