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