scripts/Windows/install_jdk22.ps1
Write-Host "Installing JDK 22 ..." -ForegroundColor Cyan New-Item "${env:ProgramFiles}\Java" -ItemType Directory -Force | Out-Null $jdkPath = "${env:ProgramFiles}\Java\jdk22" if (Test-Path $jdkPath) { Remove-Item $jdkPath -Recurse -Force } Write-Host "Downloading..." $zipPath = "$env:TEMP\openjdk-22_windows-x64_bin.zip" (New-Object Net.WebClient).DownloadFile('https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_windows-x64_bin.zip', $zipPath) Write-Host "Unpacking..." $tempPath = "$env:TEMP\jdk22_temp" 7z x $zipPath -o"$tempPath" | Out-Null [IO.Directory]::Move("$tempPath\jdk-22", $jdkPath) Remove-Item $tempPath -Recurse -Force -ErrorAction SilentlyContinue Remove-Item $zipPath -ErrorAction SilentlyContinue cmd /c "`"$jdkPath\bin\java`" --version" if ($env:INSTALL_LATEST_ONLY) { Add-Path "$jdkPath\bin" } Write-Host "JDK 22 installed" -ForegroundColor Green |