[toc]
centos7二进制安装tomcat8
1.下载安装包
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.56/bin/apache-tomcat-8.5.56.tar.gz
2.解压缩包
tar xf apache-tomcat-8.5.56.tar.gz -C /usr/local/
3.做软连接
ln -s /usr/local/apache-tomcat-8.5.56/ /usr/local/tomcat-8.5.56
4.安装jdk
这里选择下载tar包,因为下载jdk需要登陆oracle账号,因此不能使用wget
$ ls
jdk-8u251-linux-x64.tar.gz
解压缩包
tar xf jdk-8u251-linux-x64.tar.gz -C /usr/local
导出环境变量
#导出jdk环境变量
cat >/etc/profile.d/jdk8.sh<<'EOF'
export JAVA_HOME=/usr/local/jdk1.8.0_251
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre:$JAVA_HOME/lib:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME PATH CLASSPATH
EOF
#使配置生效
source /etc/profile.d/jdk8.sh
#验证
$ java -version
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)