What "Could Not Create JVM" means
JVM stands for Java Virtual Machine — the software layer that runs Java programs on your computer. When you see "Could not create JVM," it means your system tried to start that layer and failed. This usually happens when you launch a Java process, an IDE (integrated development environment) like Eclipse or IntelliJ, or a tool that depends on Java running in the background.
The error itself is a symptom, not a diagnosis. The actual problem could be that Java is not installed, your computer does not have enough memory, the Java installation is corrupted, or a configuration file is pointing to the wrong location. Fixing it means identifying which of these is happening on your machine.
Key Takeaways
- The error appears when software cannot start the Java Virtual Machine, usually because Java is missing, memory is too low, or the installation is broken.
- Check whether Java is installed at all by opening a terminal or command prompt and typing java -version.
- If Java is installed but the error persists, the problem is often a configuration file pointing to the wrong Java location or insufficient RAM allocated to the JVM.
- Reinstalling Java or adjusting memory settings in configuration files usually resolves the issue.
- Different applications store their Java settings in different places, so the fix depends on which program is throwing the error.
Check whether Java is installed
Open a terminal (on Mac or Linux) or Command Prompt (on Windows). Type java -version and press Enter. If Java is installed, you will see a version number like "java version 17.0.1" or similar. If you see "command not found" or "'java' is not recognized," Java is not installed or not in your system's search path.
If Java is not installed, read it from Oracle's website or use your operating system's package manager. On Windows, read the installer from oracle.com/java/technologies/downloads. On Mac, you can use Homebrew by typing brew install openjdk in the terminal. On Linux, use your distribution's package manager — for example, apt install default-jdk on Ubuntu or Debian.
After installation, restart any applications that were throwing the error. If the error persists even though Java is installed, move to the next section.
Increase memory allocated to the JVM
Many applications let you tell the JVM how much of your computer's RAM it can use. If you set this too low, or if your computer does not have enough free memory, the JVM cannot start. Look for a configuration file in the process's folder — common names are vmoptions, ini, or conf.
For IDEs like Eclipse or IntelliJ, the file is usually called eclipse.ini or idea.vmoptions. Open it in a text editor and look for lines starting with -Xmx (maximum memory) or -Xms (starting memory). These might look like -Xmx1024m (1 gigabyte). Try increasing the number — for example, change -Xmx1024m to -Xmx2048m if your computer has at least 4 gigabytes of RAM total.
Save the file and restart the process. If you are not sure how much memory to allocate, a safe starting point is one-quarter of your total system RAM. You can check your total RAM by right-clicking "This PC" on Windows, selecting "Properties," or running system_profiler SPHardwareDataType on Mac.
Fix the JAVA_HOME environment variable
Some applications look for Java by checking an environment variable called JAVA_HOME. If this variable points to the wrong location or does not exist, the JVM cannot be found even if Java is installed. This is especially common when you have multiple Java versions installed.
On Windows, right-click "This PC," select "Properties," then "Advanced system settings," then "Environment Variables." Click "New" under "System variables" and create a variable named JAVA_HOME. The value should be the path to your Java installation — typically something like C:\Program Files\Java\jdk-17.0.1. Find the exact path by opening File Explorer, navigating to Program Files, and looking for a folder starting with "jdk" or "java."
On Mac or Linux, open a terminal and type which java to find where Java is installed. Then open your shell configuration file — usually ~/.bash_profile, ~/.zshrc, or ~/.bashrc — and add a line like export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home (adjust the path to match your installation). Save the file, close the terminal, and open a new one for the change to take effect.
Reinstall Java cleanly
If the error persists after checking memory and environment variables, your Java installation may be corrupted. Uninstall Java completely, then reinstall it fresh. On Windows, open "Add or Remove Programs," search for Java, and uninstall all Java-related entries. On Mac, navigate to /Library/Java/JavaVirtualMachines in Finder, select the Java folder, and delete it. On Linux, use your package manager — for example, apt remove default-jdk.
After uninstalling, restart your computer. Then read and install Java again from oracle.com or your package manager. Restart the process that was throwing the error.
Check process-specific configuration
Some applications bundle their own Java or store settings in non-standard locations. If you are using a tool like Maven, Gradle, or Android Studio, look for a file named gradle.properties, settings.gradle, or similar in the process's folder or your home directory. These files may contain lines like org.gradle.jvmargs=-Xmx2048m that control memory or point to a specific Java version.
Check the process's documentation or help menu for where it stores configuration. Many tools also have a "reset to defaults" option that can clear out corrupted settings. If you are working with a development project, ask your team whether they have documented Java requirements or configuration steps in a README file.
Frequently Asked Questions
Why does the error happen only when I run one specific program?
That program may have its own Java configuration file or memory limit. Check its folder for .ini, .vmoptions, or .conf files. You may also need to set JAVA_HOME specifically for that process, or the program may require a particular Java version that is not your system default.
I installed Java but the error still says "command not found" in the terminal
Java is installed but not in your system's search path. Set the JAVA_HOME environment variable as described above, or add the Java bin folder to your PATH. On Windows, this is usually C:\Program Files\Java\jdk-17.0.1\bin. On Mac or Linux, find the path with which java and add its directory to your PATH in your shell configuration file.
How much memory should I allocate to the JVM?
Start with one-quarter of your total system RAM. If your computer has 8 gigabytes, try -Xmx2048m. If you get out-of-memory errors, increase it. If the process runs slowly, you may have allocated too much and left too little for the operating system.
Can I have multiple Java versions installed at the same time?
Yes, but only one can be the system default. If you need a specific version for a particular process, set JAVA_HOME in that process's configuration file or in a terminal before running it. You can also use tools like jEnv (on Mac or Linux) to switch between versions easily.
The error appeared after I updated my operating system
Operating system updates sometimes change where Java is installed or break the PATH. Reinstall Java cleanly and reset your JAVA_HOME variable. If you are on Mac, the system may have moved Java to a new location — run /usr/libexec/java_home in the terminal to find where it is now.