Installation

Linux

Windows

Elevate Script Permission  

Invoke-WebRequest -Uri "https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_windows-x64_bin.zip" -OutFile "jdk-22.0.2.zip"
Expand-Archive -Path 'jdk-22.0.2.zip' -DestinationPath "."
Move-Item -Path ".\jdk-22.0.2" -Destination "C:\Program Files\Java\"
setx JAVA_HOME "C:\Program Files\Java\jdk-22.0.2"
Remove-Item -Path ".\jdk-22.0.2.zip"

Usage

Version

Appendix