Mac OS X – Install Multiple Java Versions

For those who are using MAC OS, its little tricky to install multiple Java versions. Here is the simple solution to achieve this. You will need “homebrew” and some commands.

To install latest Java version:

  1. Install homebrew if you do not have it already. You can find installation instructions here.
  2. Execute command: brew cask install java
  3. This will install latest Java version

To install Java 7:

  1. Install homebrew if you do not have it already. You can find installation instructions here.
  2. Execute command: brew tap caskroom/versions
  3. Execute command: brew cask install java7
  4. This will install latest Java 7 version

To install Java 8:

  1. Install homebrew if you do not have it already. You can find installation instructions here.
  2. Execute command: brew tap caskroom/versions
  3. Execute command: brew cask install java8
  4. This will install latest Java 8 version

Homebrew-Cask is an extension to Homebrew. Click here to get more details.

Leave a Reply

Your email address will not be published. Required fields are marked *