Skip to content

Instantly share code, notes, and snippets.

@agostof
Created September 5, 2025 19:46
Show Gist options
  • Select an option

  • Save agostof/cb75ebe9c3c2eb9cdc5e3f2caf39e5a2 to your computer and use it in GitHub Desktop.

Select an option

Save agostof/cb75ebe9c3c2eb9cdc5e3f2caf39e5a2 to your computer and use it in GitHub Desktop.
OpenJDK installation MacOS

OpenJDK Installation MacOS

Here are the steps to install a specific OpenJDK version in a local directory.

First find the Java version that you need by going here: https://jdk.java.net/archive

This snippet will download version 17

cd $HOME
mkdir LOCAL_JAVA
cd LOCAL_JAVA

# version 17
curl -LO https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_macos-aarch64_bin.tar.gz
tar -xvzf openjdk-17_macos-aarch64_bin.tar.gz

# version 24
# curl -LO https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_macos-aarch64_bin.tar.gz
# tar -xvzf openjdk-24.0.1_macos-aarch64_bin.tar.gz

# if using v24 the commands will need to be modified to account for the name change 

# check that the java binary is in place:
ls jdk-17.jdk/Contents/Home/bin/java

# run jar file
~/LOCAL_JAVA/jdk-17.jdk/Contents/Home/bin/java  -jar $JAR_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment