mac安装java8
http://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac
brew tap caskroom/cask brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
brew unlink brew-cask
brew install brew-cask
And then finally:
brew cask install java