How to Fix “Could Not Create the Java Virtual Machine” Error in Windows 11

The error “Could not create the Java Virtual Machine” usually appears when launching a Java-based application, game, installer, or development tool. You may also see a message like “A fatal exception has occurred. Program will exit.” This prevents the app from starting entirely.

In most cases, this error occurs due to incorrect Java memory settings, incompatible Java versions (32-bit vs 64-bit), invalid system environment variables, or corrupted Java installation, not because Windows 11 is broken. The steps below will help you fix the issue safely and permanently.

How to Fix “Could Not Create the Java Virtual Machine” Error in Windows 11

Follow the steps in order. After each step, try launching the Java application again before moving on.

1. Restart Your PC

Temporary environment or memory allocation glitches can trigger this error.

  1. Click Start > Power > Restart
  2. Let Windows 11 fully reboot
  3. Try opening the Java-based application again

A restart refreshes system memory and environment variables.

2. Make Sure You Are Using the Correct Java Version (32-bit vs 64-bit)

Using a mismatched Java version is one of the most common causes.

  1. Press Windows + S and search for Command Prompt
  2. Open Command Prompt and type:
java -version
  1. Press Enter
  2. Check whether Java is 32-bit or 64-bit
  3. Make sure it matches your application and system architecture

Most modern Windows 11 systems require 64-bit Java.

3. Reinstall Java (Clean Install)

A corrupted or incomplete Java installation can cause VM errors.

  1. Open Settings > Apps > Installed apps
  2. Uninstall all Java versions
  3. Restart your PC
  4. Download the latest 64-bit Java from the official source
  5. Install Java Runtime Environment or JDK as required
  6. Restart your PC again

This resets all Java binaries and configuration files.

4. Check and Fix Java Memory Allocation (Xmx / Xms Values)

Incorrect memory values prevent the JVM from starting.

  1. Locate the shortcut or configuration file for the Java app
  2. Look for parameters like:
    • -Xmx
    • -Xms
  3. Reduce memory values (for example):
    • Change -Xmx2048M to -Xmx1024M
  4. Save changes and launch the app

Allocating more memory than available RAM causes JVM startup failure.

5. Remove Invalid Java Options From Environment Variables

Bad JVM arguments in system variables can break Java globally.

  1. Press Windows + R, type sysdm.cpl, and press Enter
  2. Open the Advanced tab
  3. Click Environment Variables
  4. Look for variables named:
    • _JAVA_OPTIONS
    • JAVA_TOOL_OPTIONS
  5. Select them and click Delete
  6. Click OK and restart your PC

Invalid options here apply to all Java apps and cause immediate failure.

6. Fix JAVA_HOME and Path Variables

Incorrect Java paths prevent JVM initialization.

  1. Open Environment Variables again
  2. Under System variables, find JAVA_HOME
  3. Make sure it points to the correct Java installation directory
    • Example: C:\Program Files\Java\jdk-21
  4. Edit the Path variable
  5. Remove old or duplicate Java paths
  6. Ensure the correct Java bin directory is listed
  7. Click OK and restart your PC

Multiple Java paths often cause version conflicts.

7. Run the Java Application as Administrator

Permission restrictions can block memory allocation.

  1. Right-click the Java app or launcher
  2. Select Run as administrator
  3. Try launching again

This helps with apps that require elevated memory or file access.

8. Disable Antivirus Temporarily (For Testing)

Security software can block JVM startup.

  1. Temporarily disable third-party antivirus
  2. Launch the Java application
  3. If it works, add the app and Java to exclusions
  4. Re-enable antivirus

Do not leave your system unprotected permanently.

9. Check Available System Memory

Low memory conditions can prevent JVM creation.

  1. Press Ctrl + Shift + Esc to open Task Manager
  2. Check Memory usage
  3. Close unnecessary apps
  4. Try launching the Java program again

Java requires sufficient free RAM to initialize the VM.

10. Create a New Windows User Account

Corrupted user profiles can break environment variables.

  1. Open Settings > Accounts > Other users
  2. Create a new local administrator account
  3. Sign in to the new account
  4. Install Java and test the application

If it works, the original user profile may be corrupted.

Final Thoughts

The “Could not create the Java Virtual Machine” error in Windows 11 is usually caused by invalid memory settings, broken environment variables, or Java version conflicts, not a Windows issue. In most cases, removing _JAVA_OPTIONS and reinstalling the correct 64-bit Java version fixes the problem immediately.

To avoid this issue in the future, keep only one active Java version installed, avoid excessive memory arguments, and update Java from official sources only.

Posted by Raj Bepari

I’m a digital content creator passionate about everything tech.