Centos6安装java8,tomcat8

2018年12月25日

1. java安装

# wget --no-check-certificate --no-cookies - --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
# rpm -Uvh jdk-8u131-linux-x64.rpm

2. java版本确认

# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

3. tomcat安装

# mkdir /opt/tomcat
# cd /opt/tomcat
# wget http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz
# tar xvf apache-tomcat-8.5.16.tar.gz

4. 环境变量追加

# vi /etc/profile.d/tomcat.sh


JRE_HOME=/usr/java/default
CATALINA_HOME=/opt/tomcat/apache-tomcat-8.5.37
export JRE_HOME CATALINA_HOME

5. 环境变量生效

# . /etc/profile

6. tomcat启动

# /opt/tomcat/apache-tomcat-8.5.37/bin/startup.sh

7. 页面确认

http://192.168.56.101:8080