links: Software Installation MOC


Installing adaptopenjdk using homebrew

Firstly install jdk via homebrew

brew install --cask adoptopenjdk

Now add the following function to .zshrc file to switch between different jdks

jdk() {
        version=$1
        export JAVA_HOME=$(/usr/libexec/java_home -v"$version");
        java -version
 }

tags: java