Installing multiple Java versions on Mac OS X can be a challenge due to the way Java manages its installations. However, there is a solution that allows you to easily install and manage different Java versions: Homebrew.
Homebrew is a package manager that simplifies the installation and management of software on Mac OS X. To use Homebrew to manage multiple Java versions, you will also need to install jenv, a Java version manager.
Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Homebrew jenv:
brew install jenv
Install Homebrew-cask:
brew install caskroom/cask/homebrew-cask
Install a specific Java version using cask:
brew install --cask temurin9
Add this version to jenv to manage it:
jenv add /Library/Java/JavaVirtualMachines/temurin-java9.jdk/Contents/Home
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3