离线安装JDK(.rpm)
去官网下载jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
1.解压安装
[root@localhost src]# rpm -ivh jdk-8u121-linux-x64.rpm
2、配置java环境变量
[root@bogon software]# vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_101
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
3、使/etc/profile生效
[root@bogon jdk1.8.0_101]# source /etc/profile