scripts/Windows/install_jdk19.ps1
Write-Host "Installing JDK 19 ..." -ForegroundColor Cyan New-Item "${env:ProgramFiles}\Java" -ItemType Directory -Force | Out-Null $jdkPath = "${env:ProgramFiles}\Java\jdk19" if (Test-Path $jdkPath) { Remove-Item $jdkPath -Recurse -Force } Write-Host "Downloading..." $zipPath = "$env:TEMP\openjdk-19.0.1_windows-x64_bin.zip" (New-Object Net.WebClient).DownloadFile('https://download.java.net/java/GA/jdk19.0.1/afdd2e245b014143b62ccb916125e3ce/10/GPL/openjdk-19.0.1_windows-x64_bin.zip', $zipPath) Write-Host "Unpacking..." $tempPath = "$env:TEMP\jdk19_temp" 7z x $zipPath -o"$tempPath" | Out-Null [IO.Directory]::Move("$tempPath\jdk-19.0.1", $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 19 installed" -ForegroundColor Green |