Install/Manage Multiple JAVA versions — MacOS BigSur

jenv

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install jenv
source ~/.zshrc

Install Multiple Java Versions

1. Install the latest OpenJDK

brew install java

2. Adding the JDK home to jenv

jenv add <JDK_PATH>
jenv versions

Setting a Global Java Version

jenv global <JAVA_VERSION>

Setting a Local Java Version for the current working directory

jenv local <JAVA_VERSION>

Setting a shell instance Java Version

jenv shell <JAVA_VERSION>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store