1

Recently, i've been trying to set up forge on java minecraft. However, a problem popped up where, after installing java, I would get this message upon attempting to open the forge installer: Error: could not create the Java Virtual Machine.

So, naturally, I googled the problem to see what I could do. After spending hours trying to fix this issue, and attempting seemingly every "solution", I felt exhausted. I would uninstall java, and reinstall it, even receiving the error during installation. I even tried different java versions.

Eventually, I decided to try and install forge without java, so I opened up the cmd prompt, and found this message.

Picked up _JAVA_OPTIONS: ûXmx512M Unrecognized option: ûXmx512M Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

I toyed around with sysdm, because someone said that was where the _JAVA_OPTIONS issue lied, but it wasnt. The only java options that was there was the one I created, with 1024M instead of 512M. Even when I deleted it, the error remained the same. What do I do?

EDIT: it seems like nobody has both the virtual machine error and the java options error at the same time. how did i manage this

Dave Kinnie
  • 11
  • 1
  • 1
  • 3
  • Does this answer your question? [How to solve could not create the virtual machine error of Java Virtual Machine Launcher?](https://stackoverflow.com/questions/18459945/how-to-solve-could-not-create-the-virtual-machine-error-of-java-virtual-machine) – shreyasm-dev Aug 18 '20 at 01:25
  • No it doesn't. The reason for the JVM not launching in that case is different. In that case there is simply not enough memory to launch the JVM. In this case, it looks like the option is garbled. The correct name for the option is `-Xmx512M` not `ûXmx512M`. The garbling is most likely something to do with the *way* that you are launching it. My guess is that this is down to some Minecraft related launcher bug or misconfiguration. – Stephen C Feb 04 '23 at 01:34
  • The `Picked up _JAVA_OPTIONS` is simply informational (and a security alert); see https://stackoverflow.com/questions/43715075/picked-up-java-options-xmx256m – Stephen C Feb 04 '23 at 01:36

3 Answers3

0

I Had the same error today. To fix it, I uninstalled the jdk and downloaded it again in https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html. For some reason, reinstalling only fixes the problem when you download the jdk from this link.

SteveFerg
  • 3,466
  • 7
  • 19
  • 31
  • While this *may* help some people, this is an unsatisfying answer. It doesn't help the reader understand what the problem was in the first place. That means ... we don't know if this "fix" is going to work for other people. Basically it is a "vodoo programming" fix. – Stephen C Feb 04 '23 at 01:45
0

I did some more research on this, and I came across a Reddit post:

One of the comments said:

Is there something your environmental variables causing Java to crash?

The poster said that it was and the commenter followed up with:

Looks like you fixed it, but it looks like who whoever made that variable must have copy and pasted in a bad hyphen character (probably grabbed and copy/pasted it from an editor like Word that likes to convert ANSI hyphens into Unicode variants that Java doesn't understand as an argument). You probably could have also just replaced it and retyped it with an '-' on your keyboard.


So the take-away is to check your environment variables to make sure that you didn't miss-copy them from ... wherever you got them.

For what it is worth, (just) uninstalling and reinstalling the JDK is not likely to fix this. It is not a JDK problem. It is a problem in the way that ... something ... is providing the JVM command line options.

Also ... I have see this a few times in connection with Minecraft. That suggests that maybe there are some bad Minecraft instructions or setup scripts out there.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

I had the same error today. To fix it, I uninstalled the current jdk (JDK20) and re-downloaded it in https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html . For some reason reinstalling only fixes the problem when you download the jdk from this link. Good luck.