-
Notifications
You must be signed in to change notification settings - Fork 276
Install OpenJDK
Tres Finocchiaro edited this page Feb 11, 2019
·
7 revisions
- ✅ 2.1 | ✅ 2.0 | ✅ 1.9 | ...
Quickly install OpenJDK on Mac, Windows, Linux.
- Use the
openjdk8
oropenjdk11
package provided by your Linux distribution.# Example sudo apt-get install openjdk11-jdk
- Download OpenJDK8 or OpenJDK11 Hotspot VM from https://adoptopenjdk.net/.
- From Terminal:
sudo mkdir -p /Library/Java/JavaVirtualMachines/ sudo tar -xf ~/Downloads/openjdk-*.tar.gz -C /Library/Java/JavaVirtualMachines/
- Download OpenJDK8 or OpenJDK11 Hotspot VM from https://adoptopenjdk.net/.
- From PowerShell
powershell Start-Process powershell -Verb runAs Expand-Archive -Path "$env:USERPROFILE\Downloads\OpenJDK*.zip" -DestinationPath "$env:PROGRAMFILES\OpenJDK\" #Environmental vars $env:JAVA_HOME = (Get-ChildItem -Path "$env:PROGRAMFILES\OpenJDK" | Where-Object {$_.PSIsContainer} | Sort-Object LastWriteTime -Descending | Select-Object -First 1).FullName $env:PATH += ";$env:JAVA_HOME\bin" setx /M JAVA_HOME "$env:JAVA_HOME" setx /M PATH "$env:PATH" # Registry $VERSION = ("$env:JAVA_HOME" -Split "\\jdk-")[1] $MAJOR_VERSION = ($VERSION -Split "\.")[0] + "." + ($VERSION -Split "\.")[1] reg add "HKLM\SOFTWARE\JavaSoft\JDK" /v CurrentVersion /t REG_SZ /d "$MAJOR_VERSION" /f reg add "HKLM\SOFTWARE\JavaSoft\JDK\$MAJOR_VERSION" /v JavaHome /t REG_SZ /d "$env:JAVA_HOME" /f # Cleanup Remove-Item -Path "$env:USERPROFILE\Downloads\OpenJDK*.zip"