下載jdk
URL:https://www.oracle.com/technetwork/java/javase/archive-139210.html
找到所需的版本,登錄下載(這里下載的版本是jdk-8u171-linux-x64.tar.gz)
下載tomcat
URL: https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz
解壓 jdk 安裝包
# tar -zxf jdk-8u171-linux-x64.tar.gz -C /usr/local/
解壓 apache-tomcat 安裝包
# tar -zxf apache-tomcat-8.5.31.tar.gz -C /usr/local/
修改環(huán)境變量
# vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_171
export JER_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JER_HOME/lib:$CLASSPATH
export JAVA_PATH=$JAVA_HOME/bin:$JER_HOME/bin
export PATH=$PATH:$JAVA_PATH
使環(huán)境變量生效
# source /etc/profile
啟動(dòng) tomcat
# cd /usr/local/apache-tomcat-8.5.31/ && sh bin/startup.sh
防火墻放開 8080 端口
# firewall-cmd --permanent --zone=public --add-port=8080/tcp
# firewall-cmd --reload
訪問測試頁