Skip to content

Instantly share code, notes, and snippets.

@deobald
Last active October 12, 2022 00:03
Show Gist options
  • Save deobald/00b16090a932c793379cae6422206491 to your computer and use it in GitHub Desktop.
Save deobald/00b16090a932c793379cae6422206491 to your computer and use it in GitHub Desktop.
How to install OpenJDK 11 on Mac OS Big Sur
# ==== METHOD ONE ====
brew install openjdk@17
# ==== METHOD TWO ====
#!/bin/sh
cd ~/Downloads
# Intel:
wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_macos-x64_bin.tar.gz
# ARM:
wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_macos-aarch64_bin.tar.gz
tar xf openjdk-17.0.2_macos-*_bin.tar.gz
sudo mv jdk-17.0.2.jdk /Library/Java/JavaVirtualMachines/
java -version
# => openjdk version "11" 2018-09-25
# => etc.
@jagtapl
Copy link

jagtapl commented Apr 26, 2022

Both methods didnt work for me for JDK17 but the new https://sdkman.io worked. Below are list of commands I used on the macOS Montery
curl -s "https://get.sdkman.io" | bash
source "/Users/lalitjagtap/.sdkman/bin/sdkman-init.sh"
sdk list java
sdk install java

@deobald
Copy link
Author

deobald commented Apr 26, 2022

@jagtapl Thanks! Mind if I ask what errors you received from homebrew and the manual installation? I'll try to correct the instructions.

@jagtapl
Copy link

jagtapl commented Oct 11, 2022 via email

@deobald
Copy link
Author

deobald commented Oct 12, 2022

Hm. I don't see a screenshot in this gist...?

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