#!/bin/bash yum -y install wget vim curl net-tools java -version >> /dev/null if [ $? -eq 0];then echo "JDK已经安装" > /dev/null else mkdir /opt/java cd /opt wget https://yw-du.oss-accelerate.aliyuncs.com/jdk-8u161-linux-x64.tar.gz tar xf jdk-8u161-linux-x64.tar.gz -C /opt/java sed -i '$aJAVA_HOME=/opt/java/jdk1.8.0_161' /etc/profile sed -i '$aJRE_HOME=/opt/java/jdk1.8.0_161/jre' /etc/profile sed -i '$aCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib' /etc/profile sed -i '$aPATH=$JAVA_HOME/bin:$PATH' /etc/profile sed -i '$aexport PATH JAVA_HOME CLASSPATH' /etc/profile sed -i '$aCATALINA_HOME=/opt/tomcat' /etc/profile source /etc/profile fi source /etc/profile cd /opt wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.63/bin/apache-tomcat-8.5.63.tar.gz tar -zxvf apache-tomcat-8.5.63.tar.gz mv apache-tomcat-8.5.63 tomcat bash /opt/tomcat/bin/startup.sh netstat -antulp | grep 8080
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)