cd /usr/local
mkdir tomcat
tar -xvf apache-tomcat-9.0.56.tar.gz -C /usr/local/tomcat
vim /etc/profile
export CATALINA_BASE=/usr/local/tomcat/apache-tomcat-9.0.56/
export PATH=$CATALINA_BASE/bin:$PATH
source /etc/profile
cd /usr/local/tomcat/apache-tomcat-9.0.56/bin
./startup.sh
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --reload
jdk
mkdir -p /usr/local/java
cd /usr/local/java
curl -O http://download.Oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz
vi /etc/profile
#set java environment
JAVA_HOME=/usr/local/java/jdk1.7.0_79
JRE_HOME=/usr/local/java/jdk1.7.0_79/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
source /etc/profile
java -version
网友评论