How to Update Java on Windows 11
Update Java on Windows 11 with a single winget upgrade command or by downloading and running a new MSI from Adoptium. Close open terminals before verifying — PATH changes only take effect in new windows.
winget upgrade
winget upgrade EclipseAdoptium.Temurin.21.JDK
To see what would be upgraded:
winget upgrade
This lists all packages with available updates. Look for entries with "Adoptium" or "Microsoft" in the source column and upgrade individually or all at once:
winget upgrade --all
MSI upgrade
- Download the new MSI from
adoptium.net(Java 21, Windows x64). - Close any terminals, IDEs, or apps using Java.
- Run the MSI — it upgrades in place, keeping your PATH and JAVA_HOME intact.
- Open a new PowerShell window and verify:
java -version.
Verify JAVA_HOME after update
$env:JAVA_HOME
java -version
If JAVA_HOME points to a version-specific path (e.g. jdk-21.0.1.12-hotspot) and the update changed that directory name, update JAVA_HOME manually via System Properties > Environment Variables.
Windows Update and Java
Windows Update does not manage third-party JDKs. You must update the JDK separately via winget, the vendor's installer, or your own patch management tooling (WSUS, Intune, SCCM can distribute MSI packages).
Keep old versions for compatibility
Windows installs each JDK version in its own directory — upgrading Java 21 from 21.0.1 to 21.0.3 replaces the 21.0.1 directory. But Java 17 and Java 21 coexist without conflict. Your IDE (IntelliJ, VS Code) lets you pick the JDK per project regardless of the system default.