Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

A Developer's Quick Checklist for Messy Java Installs on Windows 11

If you have ever switched between a university project, a Minecraft modding tool and a work codebase on the same Windows machine, there is a good chance you have more than one Java on it. Most of the time nobody notices.

If you have ever switched between a university project, a Minecraft modding tool and a work codebase on the same Windows machine, there is a good chance you have more than one Java on it. Most of the time nobody notices. Then a build fails with a strange class version error, or a security advisory lands and you need to know exactly what is installed. Here is a short checklist to get a clear picture.

1. Find out which java actually runs

Open Terminal and run:

java -version

The first line is the version Windows uses when anything calls plain java. The next line usually names the vendor (Oracle, Microsoft, Temurin, Zulu and so on). Write down both the major version and the vendor.

Remember the two numbering styles: 1.8.0_xxx is Java 8 in the old format, while 11.0.x, 17.0.x or 21.0.x lead with the major version.

2. List every java.exe on your PATH

where java

This prints every java.exe Windows can find on PATH, in the order it would use them. If you see three entries, the first one wins, and the other two are just sitting there. This is the single most useful command for "why is my terminal running the wrong JDK?"

3. Check JAVA_HOME separately

Many build tools and IDEs look at the JAVA_HOME environment variable instead of PATH. That means your terminal and your build can quietly use different JDKs. Check it with:

echo %JAVA_HOME%

(in Command Prompt) or $env:JAVA_HOME in PowerShell. If it points to a folder that no longer exists, or to a different major version than java -version reports, fix that first.

4. Cross-check Installed apps

PATH only shows part of the story. In Settings > Apps > Installed apps, search for "Java", "JDK", "OpenJDK", "JRE", "Temurin" and "Microsoft Build of OpenJDK", because each vendor names it differently. Older Oracle installs may show up as "Java SE" or "Java Runtime Environment".

5. Don't forget bundled runtimes

Some applications ship their own private Java. Those copies often don't appear in Installed apps and aren't on PATH, so neither command above finds them. You can't safely swap them yourself; the app's maker has to ship an update.

6. Decide what stays

A simple rule set:

  • Nothing needs it? Uninstall it. You can reinstall later if something complains.
  • A project needs a specific major version? Keep that one and keep it updated from the same vendor you installed it from.
  • Several versions you no longer use? Remove the extras from Installed apps.

After installing or removing anything, open a fresh Terminal window before re-running java -version. An old window can keep reporting stale results.

7. Update only from the vendor

Get updates from the vendor's own site: java.com for Oracle Java 8, Microsoft's download page for the Microsoft Build of OpenJDK, and adoptium.net for Temurin. Never trust a pop-up or ad saying "your Java is out of date".

This matters right now because of Java4Shell (CVE-2026-114938), which the OpenJDK advisory of 17 November 2026 lists for Java 17, 21, 25 and 27 builds up to specific versions. TechGuide HQ's guide on how to check which Java versions are installed on Windows 11 includes the affected-version table and the vendor fixed builds, so you can compare your output against it instead of guessing.

Quick recap

java -version, where java, JAVA_HOME, Installed apps, bundled runtimes, then clean up and update from the right vendor. Five minutes, and your machine stops surprising you.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.