Last active
March 5, 2025 20:04
-
-
Save douglarek/bbda8cc23a562cb5d5798717d57bc9e9 to your computer and use it in GitHub Desktop.
How to install openJDK 11 on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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) |
tar xf openjdk-11_osx-x64_bin.tar.gz
thanks, fixed
replace curl -O with curl -o
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
Had to use tar -xzvf openjdk-11_osx-x64_bin.tar.gz
to extract
I've got this error :
curl: (6) Could not resolve host: openjdk-11_osx-x64_bin.tar.gz
Moved ?
In my case the path was wrong. Changing the path from /Library/Java/JavaVirtualMachines/ to Library/Java/JavaVirtualMachines/
worked.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tar xf openjdk-11_osx-x64_bin.tar.gz