1解压

[root@nfs_Repo ~]#tar xf jdk-8u181-linux-x64.tar.gz

2创建软连接
[root@nfs_Repo ~/jdk1.8.0_181/bin]#ln -s /root/jdk1.8.0_181/bin/java /usr/bin/java

3#配置环境变量
[root@nfs_Repo ~/jdk1.8.0_181/bin]#vim /etc/profile
#java
export JAVA_HOME=/root/jdk1.8.0_181
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib

[root@nfs_Repo ~/jdk1.8.0_181/bin]#source /etc/profile

4#查看版本
[root@nfs_Repo ~/jdk1.8.0_181/bin]#java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)