Profile Image
Michael Yang

How do I enable UseG1GC via -XX:+UnlockExperimentalVMOptions?

When trying to start my modded Minecraft server, this error pops up.

 

Error: VM option 'UseG1GC' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

 

I can't seem to figure out a way to fix it and have been searching for a while. Everytime I try to do something like -XX:+UseG1GC, it just returns the java help menu instead.

  • g1gc

  • jvm

  • minecraft

  • garbagecollection

  • java

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Michael!

 

 Greetings. Looks like you are running on an old version of Java. You have two options to circumvent this problems:

 

1. Upgrade your Java to 8 or above

 

or

 

2. Remove the '-XX:useG1GC' argument from the launch script

 

 Either one should resolve your problem.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • g1gc

  • jvm

  • minecraft

  • garbagecollection

  • java