1 安裝 Homebrew
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile
$ brew doctor
2 安裝java
$ brew cask install java7
3 安裝tomcat
$ brew install tomcat
4 配置環(huán)境
$vim .bash_profile
TOMCAT_HOME=/usr/local/Cellar/tomcat/8.5.5/libexec/bin
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
PATH=$TOMCAT_HOME/bin:$PATH
PAHT=$JAVA_HOME/bin:$PAHT
export TOMCAT_HOME
export JAVA_HOME
export PATH
$ source .bash_profile (立即生效)
5 運(yùn)行
/usr/local/Cellar/tomcat/8.5.5/libexec/bin/startup.sh