how to use java 8 on mac instead of 11 code example Example 1: install java 11 mac $ brew cask install java Example 2: can i have both java7 and java 11 in mac brew search java