Commands for installing Java(TM) SE Development Kit 24 without prompts, removing it again and detecting it from deployment tools. A command is shown only when it is certain: from the manifest or the installer technology’s documented default.
Related guide: Silent install switches: MSI, NSIS, Inno Setup · Uninstall a program with the registry or PowerShell
With winget
PowerShell
winget install --id Oracle.JDK.24 -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Oracle.JDK.24 -e --silentwinget uninstall --id Oracle.JDK.24 -e --silentBy installer
64-bit · MSI · All users
Silent install
msiexec /i jdk-24.0.2_windows-x64_bin.msi /qn /norestartWrite a log
msiexec /i jdk-24.0.2_windows-x64_bin.msi /qn /norestart /l*v "%TEMP%\java-tm-se-development-kit-24-install.log"Uninstall
msiexec /x {1927BA5F-6CD9-5F60-BBB8-B6A654F98621} /qn /norestart- MSI product code
- {1927BA5F-6CD9-5F60-BBB8-B6A654F98621}
- Uninstall registry key
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1927BA5F-6CD9-5F60-BBB8-B6A654F98621}
- UpgradeCode
- {64A3A4F4-B792-11D6-A78A-00B0D0200240}
- Install folder
- %ProgramFiles%\Java\jdk-24
PowerShell: download, verify, install
Downloads the official file, checks its SHA256 and installs it silently.
install-java-tm-se-development-kit-24.ps1
$url = 'https://download.oracle.com/java/24/archive/jdk-24.0.2_windows-x64_bin.msi'
$sha256 = '04D16852CB3C394D09EE8B9AC22DB406636FEFA97662A86E5B6E8CC1F2C7B832'
$file = Join-Path $env:TEMP 'jdk-24.0.2_windows-x64_bin.msi'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Start-Process msiexec.exe -ArgumentList '/i', ('"{0}"' -f $file), '/qn', '/norestart' -Wait