Centos – Install Tomcat 9 and java 8 update 91 or java latest

Step 1 install java

To install package U91

cd /tmp
wget https://downloads.pro-wiki.com/java/u91/jre-8u91-linux-x64.rpm
wget https://downloads.pro-wiki.com/java/u91/jdk-8u91-linux-x64.rpm
rpm -ivh jre-8u91-linux-x64.rpm
rpm -ivh jdk-8u91-linux-x64.rpm

To upgrade package U91

rpm -Uvh jre-8u91-linux-x64.rpm
rpm -Uvh jdk-8u91-linux-x64.rpm

Check if the JDK was installed U91

rpm -qa | egrep -i "(jdk|jre)"
java -version

To install Latest Java

yum install java-1.8.0

Step 2 install tomcat

mkdir /data
wget http://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.12/bin/apache-tomcat-9.0.12.tar.gz
tar -xvf apache-tomcat-9.0.12.tar.gz
mv apache-tomcat-9.0.12 tomcat
echo "export CATALINA_HOME="/data/tomcat"" >> ~/.bashrc
source ~/.bashrc
cd /data/tomcat/bin
./startup.sh

 

systemctl start tomcat
systemctl restart tomcat
systemctl enable tomcat

You can change data folder to your own folder
Enjoy
🙂