How to Uninstall Java on Windows

Uninstall Java on Windows through Settings > Apps > Installed apps or with winget uninstall. Windows keeps each JDK in its own directory, so you may have several to remove.

Via Settings (GUI)

  1. Press Win+I to open Settings, then go to Apps > Installed apps.
  2. Search for "Java", "JDK", "Temurin", "OpenJDK", "Corretto", or "Oracle".
  3. Click the three-dot menu next to each entry and select Uninstall.
  4. Confirm the UAC prompt.
  5. Repeat until no Java entries remain.

Via winget

List all Java-related packages:

winget list | findstr -i "JDK\|Temurin\|Corretto\|OpenJDK"

Uninstall by ID:

winget uninstall EclipseAdoptium.Temurin.21.JDK
winget uninstall EclipseAdoptium.Temurin.17.JDK

Clean up environment variables after uninstall

The uninstaller should remove PATH entries, but JAVA_HOME may persist:

  1. Open System Properties > Advanced > Environment Variables.
  2. Under System variables, check if JAVA_HOME still exists. Delete it if so.
  3. In Path, remove any entries pointing at the old JDK \bin directory.

Verify complete removal

java -version
where.exe java

Both should say "not found" or "could not find files" if all Java installations have been removed.

Test-Path "C:\Program Files\Java"
Test-Path "C:\Program Files\Eclipse Adoptium"

Should return False.

Why uninstall Java?

Valid reasons: removing an old version you no longer need, cleaning up after a project, removing Oracle JDK to install a free OpenJDK build, or removing the legacy Java Browser Plug-in which is a security risk. The plug-in was removed in Java 11 — if you're on Java 8 for browser reasons, you should upgrade.