1、官网下载tomcat .tar.gz 的文件 如:apache-tomcat-8.0.36.tar.gz 解压,考到Libray 目录下,修改文件名为Tomcat
2、终端进入 /Library 下 修改文件权限 sudo chmod 755 /Library/Tomcat/bin/*.sh
3、按回车键之后会提示输入密码,请输入管理员密码。之后输入并回车:sudo sh startup.sh
如:
Using CATALINA_BASE: /Users/xuanyue/Library/Tomcat
Using CATALINA_HOME: /Users/xuanyue/Library/Tomcat
Using CATALINA_TMPDIR: /Users/xuanyue/Library/Tomcat/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home
Using CLASSPATH: /Users/xuanyue/Library/Tomcat/bin/bootstrap.jar:/Users/xuanyue/Library/Tomcat/bin/tomcat-juli.jar
Tomcat started.
则成功,验证:在浏览器张输入:http://localhost:8080