Install Multiple Java Versions on macOS High Sierra
Install Homebrew Cask
On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.
You don't need to install cask anymore, you just need homebrew. Try using any cask command
Install Homebrew Cask first if you haven’t: