CentOS6.5 install Java 8 and Tomcat8

Install Java8

Ready to work

Update software

yum update

Check if java has been installed

java -version

If it appears as shown, it means it is not installed
Uninstall if previously installed

# View the built-in JDK
rpm -qa | grep jdk

# Uninstall the built-in JDK
yum remove java-1.6.0-openjdk
yum remove java-1.7.0-openjdk

Check if wget download tool is installed
If you enter wget, the display is as follows:

It means that wget has been installed. If there is no wget command, you must install wget as follows:

yum install wget

Download wget.rpm by offline download
Download wget.rpm and upload it to Linux server http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/wget-1.14-10.el7_0.1.x86_64.rpm

Install wget

rpm -ivh wget-1.14-10.el7_0.1.x86_64.rpm

Download java8

1、 RPM installation

Download RPM online

### For 32 bit
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie""http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-i586.rpm"

### For 64 bit
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie""http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm"

If the following error is reported:

Refer to the following solutions:
http://blog.csdn.net/angel22xu/article/details/25070373

Download again

Download RPM offline
download link:
http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm?AuthParam=1462805862_8be369be38fdce92bf8162c929be817b
Upload the downloaded rpm file to the Linux server and install

Install RPM

rpm -ivh jdk-8u91-linux-x64.rpm

Test whether the installation is successful

java -version

2、 tar.gz installation (I use this method)
Download tar.gz online

wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz?AuthParam=1462934736_6fb6b206c0b3018e3ad5642e2893687b

Download tar.gz offline

download link:
http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz?AuthParam=1462934736_6fb6b206c0b3018e3ad5642e2893687b

Upload the tar.gz file
Unzip and install tar.gz

mkdir /ilkhome
chmod 777/ilkhome
tar -zxvf jdk-8u91-linux-x64.tar.gz -C /ilkhome

Configure environment variables

# Modify the configuration file
vi /etc/profile
# Add under export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

export JAVA_HOME=/ilkhome/jdk1.8.0_91
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

# Refresh the configuration file
source /etc/profile

Test as above

At this point, CentOS6.5 successfully installed Java8

Install Tomcat8

Here is installed by offline decompression tar.gz
download:

wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.0.51/bin/apache-tomcat-8.0.51.tar.gz

Unzip:

mkdir /ilkhome
chmod 777/ilkhome
tar -zxvf apache-tomcat-8.0.51.tar.gz -C /ilkhome

Start Tomcat:

cd /ilkhome/apache-tomcat-8.0.51/bin/./startup.sh

Add port 8080 to the firewall exception and restart (the following are also unnecessary)

/sbin/iptables -I INPUT -p tcp --dport 8080-j ACCEPT
/etc/rc.d/init.d/iptables save

Just visit port 8080 to test

Attachment: /etc/init.d/iptables status can view firewall open ports

Recommended Posts

CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
CentOS6.5 install Java 8 and Tomcat8
Centos6.5 install Tomcat
CentOS 7 install Java 1.8
CentOS 7 install Java 1.8
virtualBox install centos, and build tomcat
Install centos7 and connect
CentOS7 install JDK8, tomcat8
How to install and uninstall tomcat on centos
CentOS 7 install JAVA environment (JDK 1.8)
CentOs7.3 compile and install Nginx 1.9.9
Centos7.6 method to install Tomcat-8.5.39
CentOS 7 install Mono and MonoDevelop
Centos compile and install Git
Centos6.5 install and configure mongodb
CentOS7 install python3 and pip3
Install Java JDK8 under CentOS6
CentOS7 install OracleJDK and JRE
CentOS6 install and crack Jira 7
Centos7 compile and install ntp-4.2.8p11
CentOS 6.9 compile and install python
CentOS6 install and crack confluence
CentOS 6 compile and install python 3
CentOS6 install and crack Jira 7
1.5 Install Centos7
Centos 7 install jdk and package service service
Install and configure keepalived under CentOS 5.9
CentOS Yum compile and install MySQL 5.6
Tencent Cloud Centos7 install java server
How to install Java on CentOS 8
CentOS8 install jdk8 / java8 tutorial (recommended)
Tencent Cloud Centos7 install java server
CentOS 6.x compile and install Nginx
Install java in yum mode in Centos
CentOS7 compile and install L(A|N)MP environment
CentOS7.3 install iptables and detailed use
Deploy and optimize Tomcat under Centos
CentOS quickly install Python3 and pip3
How to install Tomcat 9 on CentOS 8
CentOS7 yum install and start mysql
CentOS 8 - install and configure NFS service
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos7 uninstall openJdk, and install JDK1.8
Install Python3 and ansible under CentOS8
Install and use docker under CentOS 6.8
CentOS 7 Tomcat service installation and configuration
CentOS7 install and use SQL Server
Centos7 build java web server tomcat
CentOS Minimal install and configure TIPS
Install Python3 and Py under CentOS7
Install and configure FreeIPA in Centos7
Linux CentOS6 compile and install Pyt
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3
Compile and install libmodbus library under CentOS7
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker