Java setup
- Installation
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
download Java SE Development Kit 8u181 for Mac OS X x64
- ENV Variables环境变量配置
finder: 进入library目录,可以找到对应的java目录
打开terminal终端
sudo vim ~/.bash_profile
输入i
添加下列内容:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home" //根据自己安装的版本
export PATH="$JAVA_HOME/bin:$PATH"
export CLASSPATH=".:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar"
输入esc
,再输入:wq
完成编辑
- Verify Installation测试安装是否完成
java -version
get result:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Tomcat setup
- Installation
https://tomcat.apache.org/download-70.cgi
下载你需要的版本 - Run tomcat
解压即可,terminal进入bin目录
./startup.sh
启动tomcat,通过浏览器访问 https://lcoalhost:8080
停止tomcat服务
./shutdown.sh