How to uninstall Oracle JDK 21 on Windows
Keep Java projects and check which tools depend on Oracle JDK 21 before uninstalling it.
Quit the app
Close Oracle JDK 21 and any work it is running, then use Task Manager (Ctrl+Shift+Esc) to check for its remaining processes.
Use its uninstaller
Open Settings › Apps › Installed apps, find Oracle JDK 21 and choose Uninstall. Use the vendor uninstaller rather than deleting its program folder.
winget uninstall --id Oracle.JDK.21 --exact
For this installation, winget invokes the registered removal method. It is not a separate cleanup of user data. Windows may ask for administrator approval.
Check the result
winget list --id Oracle.JDK.21 --exact
Test-Path -LiteralPath "${env:ProgramFiles}\Java\jdk-21.0.12" -ErrorAction Stop
Read winget's result as well as its exit status: an explicit no-installed-package result concerns only this package, while a source, access or query error leaves the answer unknown. A successful Test-Path returning True means that exact location remains; False means it is absent. Neither result checks other paths. The commands do not delete anything.
What Mole lists
| Location | Item | Default |
|---|---|---|
%ProgramFiles%\Java\jdk-21.0.12 |
Program files | Goes with the app row |
%ProgramFiles%\Java\jdk-21.0.12 |
Usage records for this program | Selected by default |
The MSI completed. The selected program directory was removed and its usage records were already absent. This test covered the x64 MSI running on ARM64, not an installation with active Java workloads.
These defaults assume Remove data and settings with apps is off. Explicit Select all or Also remove user data can include the listed personal-data rows. Check the selection before confirming. Selected files that Mole removes go to the Recycle Bin; selected registry entries are backed up before removal. The vendor uninstaller has its own deletion behavior.
What this test covered
Recorded on 2026-10-20: Oracle JDK 21, version 21.0.12.0, machine-wide, MSI, winget package Oracle.JDK.21. The evidence comes from an ARM64 Windows test environment and a development build of Mole. It does not certify the current downloadable package or removal of real signed-in accounts, synchronized data or production projects.
Vendor documentation. The paths and removal results above are observations from the Windows test unless explicitly attributed to the vendor.
