CentOS7 installing Java 8 and TOMCAT8

Source: Internet
Author: User
Tags gz file

Installing JAVA8 preparing to update the software
update
See if Java is already installed
java -version

If it appears, the description is not installed

Uninstall if you have previously installed

#查看内置的JDKrpm -qa | grep jdk#卸载内置的JDKyum remove java-1.6.0-openjdkyum remove java-1.7.0-openjdk
Check whether the wget download tool is installed

If the input wget is displayed as follows:

Note that wget is already installed, and if the prompt does not have a wget command, you must first install the wget as follows:

install wget

Download wget.rpm by offline download
Download wget.rpm upload 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

Installing wget

#安装rpm -ivh wget-1.14-10.el7_0.1.x86_64.rpm
Download java81, RPM installation Download RPM Online
# # # for the + bitwget--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 the bitwget--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 resolution:
http://blog.csdn.net/angel22xu/article/details/25070373

You can download it again

offline Download RPM


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
-ivh jdk-8u91-linux-x64.rpm

Test whether the installation was successful

java -version

As follows:

2, tar.gz installation (I use this way) Download tar.gz Online
wget http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz?AuthParam=1462934736_6fb6b206c0b3018e3ad5642e2893687b
offline Download tar.gz


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

Upload the tar.gz file up

Unzip the installation tar.gz
#上传解压tar -zxvf jdk-8u91-linux-x64.tar.gz -C /opt/soft

Configuring Environment variables

# 修改配置文件vi /etc/profile# 在export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL下添加export JAVA_HOME=/opt/soft/jdk1.8.0_91export PATH=$JAVA_HOME/bin:$PATHexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar# 刷新配置文件source /etc/profile

Test above

CentOS7 successfully installed JAVA8

Installing TOMCAT8

This is installed using an offline decompression tar.gz method.

Download:

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

Extract:

-zxvf apache-tomcat-8.0.33.tar.-C /opt/soft

To start Tomcat:

cd /opt/soft/apache-tomcat-8.0.33/bin/

Add port 8080 to the firewall exception and restart

firewall-cmd--zone=public--add-port=8080/tcp--permanentfirewall-cmd--reload

Access 8080-Port testing

CentOS7 installing Java 8 and TOMCAT8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.