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

created at 06-21-2022 views: 8

problem

Today, when I opened IDEA, I got an error when I ran the program:

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

I googled it and there are two meanings:

  1. Probably means that our JAVA does not create a virtual machine
  2. The stack memory of JAVA is not enough to run the JVM

analysis

Because I have been trying some Test with multiple threads recently, my direction is to solve the problem of insufficient stack memory first.

  1. I first tried to change the idea64.exe.vmoptions configuration file in IDEA's help, but it didn't work. I tried to restart IDEA and found that it couldn't be opened, and then restarting the relationship did not work. Baidu spent a long time probably because it was caused by plug-ins after cracking IDEA, and I had no choice but to reinstall it.

  2. Later, I started to try to run java and javac with cmd, and found that such an error was reported

<JAVA_HOME>/lib/ext exists, extensions mechanism no longer supported; Use -classpath instead.
.Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

At first I thought it was a problem with my environment variable configuration, and I saw an article later

solution

<JAVA_HOME>/lib/ext exists, extensions mechanism no longer supported; Use -classpath instead.
.Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
  1. You can delete the ext folder under the lib of java, and the problem will be solved.
  2. If the idea can't be opened and goole can't help, it can only be reinstalled
created at:06-21-2022
edited at: 06-21-2022: