How to uninstall Temurin JDK 21 on Windows
Temurin's own uninstaller removes everything it installs, including its version-specific program folder, so this is a short guide. What it never touches is your own projects, Maven or Gradle's caches, and any JAVA_HOME or PATH entry you set by hand. This guide covers Eclipse Temurin JDK 21 installed machine-wide from the EclipseAdoptium.Temurin.21.JDK winget package.
Close anything using this JDK first
Close any terminal, IDE or build tool that has java, javac or a build daemon running against this JDK. Check Task Manager (Ctrl+Shift+Esc) for java.exe before you uninstall, and stop any Gradle or Maven daemon you started (gradlew --stop) if it points at this install.
Remove the app with its own uninstaller
Go to Settings › Apps › Installed apps, find Eclipse Temurin JDK with hotspot 21 (x64), and choose Uninstall, or run:
winget uninstall --id EclipseAdoptium.Temurin.21.JDK
Check JAVA_HOME and PATH
If you set JAVA_HOME to this JDK's folder, or added its bin folder to PATH yourself, the uninstaller leaves both alone. Check System Properties › Environment Variables afterward and remove or repoint any entry that still names this version's folder.
Where the data lives
| Location | What it holds | What to do |
|---|---|---|
Program Files\Eclipse Adoptium\jdk-21.0.12.101-hotspot |
This JDK's own binaries and libraries | Removed by the uninstaller |
Your JAVA_HOME and PATH entries, if you set them |
Point at this JDK's folder | Not touched by the uninstaller; update them yourself |
Maven's .m2\repository and Gradle's caches, if you use them |
Downloaded build dependencies, shared across JDK versions | Not related to this JDK specifically; leave alone unless you are cleaning those tools separately |
Because each Temurin release installs into a version-named folder like the one above, a newer or older Temurin build you also have installed lives in its own separate folder and is not affected by removing this one.
Check the result
Run these read-only commands after the uninstall finishes, ideally from a new terminal window:
java -version
winget list --id EclipseAdoptium.Temurin.21.JDK
Test-Path "$env:ProgramFiles\Eclipse Adoptium\jdk-21.0.12.101-hotspot"
$env:JAVA_HOME
java -versionfailing with "not recognized" means nojavais on your PATH; printing a version means either the uninstall did not finish or another JDK is still installed.- A completed
winget listquery with no match means the package record is gone; a matching row means the uninstall did not finish. Test-PathreturningFalsemeans this JDK's folder is gone;Truemeans files remain there.$env:JAVA_HOMEprinting this JDK's old path means you should update or clear it yourself; it is never changed automatically.
If you installed it with winget
winget uninstall runs the same MSI uninstaller Settings › Apps uses and removes the same files; it does not touch environment variables, your projects, or Maven or Gradle caches.
What Mole lists
For Temurin JDK 21 installed machine-wide from winget, the install folder and its usage record are selected by default, and the vendor's Eclipse Adoptium parent folder is removed by the MSI uninstaller itself once every version under it is gone.
What this test covered
Tested with Eclipse Temurin JDK 21.0.12.101 installed through winget, machine scope, MSI, elevated.
