Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home » Windows

How to Fix “Could Not Create The Java Virtual Machine” Error

Nishant AryalBy Nishant AryalSeptember 24, 2022
could not create the java virtual machine

Users generally encounter this problem while loading Java-based programs like Minecraft and IDE packages such as Eclipse. The Java Virtual machine (JVM) interprets the Java  Byte code into a  machine-readable form. When you try to load any java application, the interpreter JVM fails to run, ultimately leading to Could not create the java virtual machine error.

Usually, this error is generated if the RAM allocation for Java is set lower than what it really requires. You can reconfigure the heap size to get rid of this issue. There are other reasons as well that can certainly give rise to this Java error. We will delve into the fixes for all the various causes of this problem and help you figure it out through this article.

Table of Contents

  • Reasons for “Could Not Create The Java Virtual Machine” Error
  • Fix: “Could Not Create The Java Virtual Machine” Error
    • Increase the RAM allocation
    • Update the Path Variable
    • Run Java With Administrative Privileges
    • Reinstall Java
    • Configure Java from the Eclipse Configuration file 

Reasons for “Could Not Create The Java Virtual Machine” Error

Some of the possible reasons for getting Could Not Create The Java Virtual Machine are listed here.
  • Insufficient Administrative Privileges
  • Low heap memory allocated
  • Incorrect Path variable set for Java
  • Outdated or corrupted Java Development Kit (JDK) or Run time environment (JRE)

Fix: “Could Not Create The Java Virtual Machine” Error

This problem generally gets solved for most users by allocating greater heap memory size. If you have been using an IDE like Eclipse, you can also configure the VM from its .ini file to eliminate the problem.  

Increase the RAM allocation

If you need to run some intensive applications on JVM, you will require a higher heap size. The heap size is set by default at 256 MB. If the required amount of memory is not allocated to the JVM, you can encounter the Java Could not create the Java virtual machine error. Follow these steps to give Java VM a RAM allocation of 512 MB. 

  1. Press Windows key + R, type sysdm.cpl, and hit enter.
  2. Go to the Advanced tab and click on the Environment variables button.Environment variables settings
  3. Under the System variables, click on New to create new path variables.Add new system variable
  4. On the Variable options, give the variable name _JAVA_OPTIONS and assign a Variable value -Xmx512M and click on Ok.New system Variable
  5. Again, Click on Ok to save the changes.

Update the Path Variable

Windows operating system uses path variables to point to and enable the executable files of Java. If this path is not defined correctly, you might get issues such as the Could not create the Java virtual machine. Follow these steps to specify the path for Java.

  1. Go to C:\Program Files\Java and enter the folder of the Java development kit(JDK) that you want to use.java directory
  2. Go to the bin folder and copy the file path of this location. Here, we are copying the file path C:\Program Files\Java\jdk-19\bin. This file directory can be different for your device.Java bin folder directory
  3. Press Windows + R   to open Run.
  4. Type sysdm.cpl and hit enter.
  5. Go to the Advanced Tab.
  6. Click on Environment Variables.
    Environment variables settings
  7. Under system variables, double click on Path variable to edit it.Add new system variable
  8. Click on the New button and paste the file path of the JDK we copied earlier in the field. Then click on OK.Edit environment variables
  9. Finally, click on OK to save the changes. 

Run Java With Administrative Privileges

If the Java executable file is not offered sufficient privileges in the Windows OS, you might get such error messages.

  1. Open the File explorer and go to the folder directory where the Java Run time Environment (JRE) is installed. In this case, JRE is installed at
    C:\Program Files\Java\jre1.8.0_341\bin
  2. Find java.exe executable file and right-click on it.
  3. Click on Properties.Properties of Java.exe
  4. Go to the Compatibility tab.
  5. Under the Settings section, check the Run this program as an administrator option. 
  6. Click on Apply to save changes. Run java with elevated privileges

Reinstall Java

If you are still getting the error message, the issue could be with Java itself. The files related to it may have gone corrupted, or the version you may be using is outdated and not compatible. You can reinstall Java to get it to work well. Press Windows Key + I and open the Windows Settings.

  1. Go to Apps > Apps & featuresApps apps and features . 
  2. Search for Java and click on the three dots on the side of it.
  3. Click on Uninstall and give you a confirmation to remove it. 
  4. Now, go to Java’s download page and download the preferred version.
  5. Finally, run the executable file and install Java. Uninstall JAVA

Note: Install the appropriate version of Java (64 or 32-bit) for the application you’re using. For compatibility with all the Java-based applications, you can install both 64 and 32-bit Java.

Configure Java from the Eclipse Configuration file 

Eclipse is an IDE built for different programming languages but is most commonly used for Java. To solve the issue of Could not create the java virtual machine, you can edit the .ini file located in Eclipse’s installed directory. For most users, setting a line pointing the jvm.dll in the eclipse.ini file solves the issue. 

  1. Go to the folder location where Eclipse IDE is installed.
  2. Search for eclipse.ini file and open it in Notepad.
  3. Now, remove the line pointing to the VM.
    -vm C:\Program Files\Java\jdk-19\bin
  4. Set -Dosgi.requiredJavaVersion=1.5 to the currently installed JDK version. Here the JDK version is 19.
    -Dosgi.requiredJavaVersion=19
  5. Add a new line above the -vamargs line. Replace the JRE field with your currently installed version.
    -vm C:\Program Files\Java\jre1.8.0_341\bin\javaw.exe
  6. Add a line pointing to jvm.dll
    C:\Program Files\Java\jre1.8.0_341\bin\server\jvm.dll
  7. Finally, save the eclipse.ini file.eclipse ini file

Note: The file paths and the JDK/ JRE versions mentioned in the syntaxes can be different for your system. Therefore, replace the versions and directories by verifying them on your device. 

fix
Nishant Aryal
  • LinkedIn

Nishant is an enthusiast who loves writing about technology. He also is heavily invested in keeping himself updated about the latest happenings in the tech world. At Tech News Today, he covers Operating Systems, how-to-topics, and Fixes.

Related Posts

how to turn off hardware acceleration

How to Turn Off Hardware Acceleration

September 22, 2023
what happens if you turn off your computer during an update

What Happens if You Turn Off Your Computer During an Update?

September 18, 2023
How to Disable Integrated Graphics

How to Disable Integrated Graphics?

September 16, 2023
System Restore Stuck

How To Fix Windows Stuck on System Restore

September 16, 2023
startup-repair-couldn't-repair-your-pc

How To Fix “Startup Repair Couldn’t Repair Your PC”

September 13, 2023
how to free up ram

How to Free Up Memory

August 4, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how to turn off hardware acceleration

How to Turn Off Hardware Acceleration

September 22, 2023
motherboard chipset

Understanding Motherboard Chipset and Its Importance

September 20, 2023
Naval-Warfare-Games

Best Naval Warfare Games

September 18, 2023
You may also like
printer-not-printing

How to Fix a Printer That’s Not Printing

September 20, 2023
Share Location With Friends and Family

Share Location With Friends and Family (iPhone and Android)

September 18, 2023
how-to-print-without-a-printer

How to Print Without a Printer

September 18, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.