Skip to content

Install OpenJDK

Tres Finocchiaro edited this page Feb 9, 2019 · 7 revisions

Compatibility

  • ✅ 2.1 | ✅ 2.0 | ✅ 1.9 | ...

Objective

Quickly install OpenJDK on Mac, Windows, Linux.

Windows

  1. Download Java 8 or Java 11 from https://adoptopenjdk.net/.
  2. From PowerShell
    powershell Start-Process powershell -Verb runAs
    Expand-Archive -Path "$env:USERPROFILE\Downloads\OpenJDK*.zip" -DestinationPath "$env:PROGRAMFILES\OpenJDK\"
    $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 PATH "$env:PATH"
    Remove-Item -Path "$env:USERPROFILE\Downloads\OpenJDK*.zip"

Clone this wiki locally