Switch Between Different Versions of Java To install previous or specific versions of JDKs, you can get them from AdoptOpenJDK: $ brew tap adoptopenjdk/openjdk Install Specific Versions of Java (Java8, Java11, Java13) To install the latest version of Java, all you need to do is: $ brew cask install java Install Latest Version of Java Using Brew Next, install Homebrew Cask $ brew tap homebrew/cask-versions If not, you can install it via: $ ruby -e '$(curl -fsSL )'
Pre-requisitesīefore we start, make sure you have Homebrew installed on your Mac. In this article we show how to install Java on Mac using Homebrew, and how to allow to switch between different versions such as Java8, Java11, Java13 and latest Java version. You can have multiple versions of Java on your Mac.