[JAVA] Change JDK and Tomcat versions on CentOS

Introduction

I did it the other day, so I made a note of how to do it. Almost the same content as the reference site.

Tools used

--Linux environment (CentOS6 this time)

procedure

Follow the steps below to change the JDK and Tomcat versions.

  1. Remove tomcat installed with yum
  2. Remove the JDK installed with yum
  3. Install the new version of the JDK
  4. Install a new version of tomcat
  5. Confirmation

1. Remove tomcat installed with yum

Stop tomcat

sudo service tomcat6 stop
sudo /etc/rc.d/init.d/tomcat6 stop

Stop tomcat

sudo chkconfig tomcat6 off

Check the installed tomcat

yum list installed | grep tomcat

Uninstall tomcat

sudo yum remove -y tomcat6 tomcat6-webapps tomcat6-admin-webapps apache-tomcat-apis.noarch tomcat6-el-2.1-api.noarch tomcat6-jsp-2.1-api.noarch tomcat6-lib.noarch tomcat6-servlet-2.5-api.noarch

2. Remove the JDK installed with yum

Check the installed JDK

yum list installed | grep jdk

Uninstall the JDK

sudo yum remove -y java-1.7.0-openjdk.i686 java-1.7.0-openjdk-devel.i686

3. Install the new version of the JDK

Download the JDK

Download and transfer the JDK tar file from the following address

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Extract the transferred tar file

tar xvf jdk-8u5-linux-i586.gz

Move directory

sudo mv jdk1.8.0_05 /usr/local/java/jdk1.8.0_05

Cd to the moved directory

cd /usr/local/java/

Create a symbolic link with the version name removed

sudo ln -s jdk1.8.0_05 jdk

Set environment variables for JAVA_HOME

export JAVA_HOME="/usr/local/java/jdk"

Remove pre-installed java and javac symlinks

cd /usr/bin
sudo rm java
sudo rm javac

Create by downloading the symbolic link and specifying it in the set location

sudo ln -s $JAVA_HOME/bin/java java
sudo ln -s $JAVA_HOME/bin/javac javac

Check java version

It is OK if it is the installed version.

java -version
javac -version

4. Install a new version of tomcat

Download the version of Tomcat you want to install

Download Tomcat 8 here. tomcat8 download page http://tomcat.apache.org/download-80.cgi

Download the binary distribution tar file

Extract the downloaded binary distribution

tar -xvzf apache-tomcat-8.0.9.tar.gz

Move the unzipped directory

sudo mv apache-tomcat-8.0.9 /usr/local/tomcat8

Start tomcat

sudo /usr/local/tomcat8/bin/startup.sh

5. Confirmation

Let's access it with a browser

http://localhost:8080

reference

When updating the latest version of JDK and Tomcat installed on CentOS with yum

Recommended Posts

Change JDK and Tomcat versions on CentOS
Tomcat v8 on CentOS7
Java version change on CentOS
Enable Openjdk10 and maven on CentOS
Install JDK and JRE on Ubuntu 16.10
Install Java Open JDK 8 on CentOS 7
Install Java 9 on windows 10 and CentOS 7
Installing and configuring ClipBucket and Nginx on CentOS 7
Switch between GUI and CUI on CentOS6.
Link Apache and Tomcat in a blink of an eye on CentOS 8
JSP on tomcat
moved! JSF + CDI on Tomcat and Bean Validation
Apache and tomcat
OpenVPN on CentOS 8
Steps to set up Postfix and Dovecot on CentOS 8.3
I installed CentOS 8 on Windows 10 using VirtualBox and Vagrant
Maven on CentOS 7 tutorial
Docker installation on CentOS 6
Use perltidy on CentOS 8
Try OpenLiteSpeed on CentOS8
Install Neo4j 4.1.3 on centOS
Install Vertica 10.0 on CentOS 6.10
Zabbix 5 installation on CentOS 8
Use mod_auth_cas on CentOS 8
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Switch between JDK 7 and JDK 8
Use bat on Centos.
Jetty v8 on CentOS7
OpenJDK installation on CentOS 7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
1002 error on tomcat + webSocket
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
Procedure to link httpd and Tomcat9 with CentOS8.3 (multiple ProxyPass)
Remote debug connection to tomcat running multiple times on CentOS7
Install rsync on CentOS8 (version check) and file backup (synchronization)