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:
- Install homebrew if you do not have it already. You can find installation instructions here.
- Execute command: brew cask install java
- This will install latest Java version
To install Java 7:
- Install homebrew if you do not have it already. You can find installation instructions here.
- Execute command: brew tap caskroom/versions
- Execute command: brew cask install java7
- This will install latest Java 7 version
To install Java 8:
- Install homebrew if you do not have it already. You can find installation instructions here.
- Execute command: brew tap caskroom/versions
- Execute command: brew cask install java8
- This will install latest Java 8 version
Homebrew-Cask is an extension to Homebrew. Click here to get more details.