一、安装JDK并配置环境
1)下载
网址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2)安装并配置环境变量
安装JDK
1.终端输入/usr/libexec/java_home -V获取jdk安装目录
2.输入sudo vim /etc/profile
3.粘贴:
JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"
CLASSPAHT=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH:
export JAVA_HOME
export CLASSPATH
export PATH
4.添加完后,按下esc退出插入模式。输入:wq!
5.输入source /etc/profile马上生效
二、安装Tomcat
1)下载
网址:http://tomcat.apache.org/download-90.cgi
2)改名:Tomcat
解压缩,改名Tomcat
移动到/Library/
3)赋予权限
chmod 755 /Library/Tomcat/bin
4)开启
sh /Library/Tomcat/bin/startup.sh
如果开启失败或浏览器访问失败可以查看日志,tail /Library/Tomcat/logs/catalina.out
5)浏览器访问localhost:8080
6)关闭
sh /Library/Tomcat/bin/shutdown.sh
三、安装Jenkins
1)下载
http://updates.jenkins-ci.org/download/war/
2)移动
把下载好的war包移动到/Library/Tomcat/webapps
3)打开
浏览器访问http://localhost:8080/jenkins/