Skip to content

Instantly share code, notes, and snippets.

@douglarek
Last active February 13, 2024 14:51
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save douglarek/bbda8cc23a562cb5d5798717d57bc9e9 to your computer and use it in GitHub Desktop.
Save douglarek/bbda8cc23a562cb5d5798717d57bc9e9 to your computer and use it in GitHub Desktop.
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
@ktiniatros
Copy link

tar xf openjdk-11_osx-x64_bin.tar.gz

@douglarek
Copy link
Author

tar xf openjdk-11_osx-x64_bin.tar.gz

thanks, fixed

@George199809
Copy link

replace curl -O with curl -o

@JPauloMoura
Copy link

Using mac os Big sur, I had to add the environment variable
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home" in my ~/.zshrc file for it to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment