When developing on Mac OS X, multiple Java versions might be necessary for various projects with different compatibility requirements. This article explores how to effectively install and manage multiple Java versions on a Mac.
Homebrew, a popular package manager for Mac, offers a convenient solution to managing multiple Java versions. It includes homebrew-cask for installing Java versions and jenv for managing them.
Add the homebrew/cask-versions tap to Homebrew: brew tap homebrew/cask-versions
Search for specific versions using: brew search temurin. Then, install them: brew install --cask temurin8, brew install --cask temurin9.
Each installed Java version has a different path. Use /usr/libexec/java_home -V to check paths. On Mac OS X Mavericks, there are three common paths:
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