Skip to content

Instantly share code, notes, and snippets.

@TopekoX
Last active March 20, 2022 06:28
Show Gist options
  • Save TopekoX/f00d15bb7f3ebae9f44ed8ac51c87cad to your computer and use it in GitHub Desktop.
Save TopekoX/f00d15bb7f3ebae9f44ed8ac51c87cad to your computer and use it in GitHub Desktop.

Download

Download Open JDK on https://jdk.java.net/. Example jdk version is using 17, then extarct jdk archive, and move to directory where you want, recommended jdk location move at /Library/Java/JavaVirtualMachines/.

Setting Path

Edit file .bashrc or .profile or .zshrc at your home place, and register bin jdk on path, add this code at bottom:

export PATH="/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home/bin:$PATH"

check the list of installed JDK

/usr/libexec/java_home -V

# output
Matching Java Virtual Machines (1):
    17.0.2, x86_64:	"OpenJDK 17.0.2"	/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home

/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment