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)
- Press Win+I to open Settings, then go to Apps > Installed apps.
- Search for "Java", "JDK", "Temurin", "OpenJDK", "Corretto", or "Oracle".
- Click the three-dot menu next to each entry and select Uninstall.
- Confirm the UAC prompt.
- 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:
- Open System Properties > Advanced > Environment Variables.
- Under System variables, check if
JAVA_HOMEstill exists. Delete it if so. - In Path, remove any entries pointing at the old JDK
\bindirectory.
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.