Microsoft Build of OpenJDK with Hotspot 21 silent install and uninstall

The Microsoft Build of OpenJDK is a new no-cost long-term supported distribution and Microsoft's new way to collaborate and contribute to the Java ecosystem.

MSI x64arm64 Updated 19 Oct 2026
Vendor
Microsoft Corporation
Category
Runtimes
Installer
Windows Installer (MSI, built with WiX)
Architecture
x64, arm64
Checked version
21.0.12.101
winget ID
Microsoft.OpenJDK.21
Product code
{C6327818-924B-4976-92A3-522FBCD5F725}
License
GPL2 with Classpath Exception
Download
Official download

Silent install

msiexec /i microsoft-jdk-21.0.12.1-windows-x64.msi /qn /norestart ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome
  1. Download the installer from the direct download link.
  2. Open an elevated Command Prompt: right-click Command Prompt and select Run as administrator.
  3. Change to the folder with the installer, for example cd C:\Temp.
  4. Run the command above. Adjust the file name if you downloaded a different version.

Or install with winget

winget install --id Microsoft.OpenJDK.21 --exact --silent --scope machine --accept-package-agreements --accept-source-agreements

Silent uninstall

MSI
msiexec /x {C6327818-924B-4976-92A3-522FBCD5F725} /qn /norestart
winget
winget uninstall --id Microsoft.OpenJDK.21 --exact --silent --accept-source-agreements

Run the command from an elevated Command Prompt.

About the Windows Installer (MSI, built with WiX) installer

An MSI built with the WiX Toolset. It is installed with msiexec and accepts the standard MSI switches.

SwitchWhat it does
/qnNo user interface.
/norestartNever restart, even if the installation needs it.
/l*v "C:\Temp\install.log"Verbose log file.

Deploy Microsoft Build of OpenJDK with Hotspot 21 with Microsoft Intune

Package the installer as a Win32 app (.intunewin) and use these settings:

Install commandmsiexec /i microsoft-jdk-21.0.12.1-windows-x64.msi /qn /norestart ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome
Uninstall command msiexec /x {C6327818-924B-4976-92A3-522FBCD5F725} /qn /norestart
Install behaviorSystem
Detection ruleMSI product code {C6327818-924B-4976-92A3-522FBCD5F725}

More runtimes apps