https://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html#A1098871
建议采用rpm方式安装,可以自动设置环境变量
1. jdk8安装包下载位置:
链接:https://pan.baidu.com/s/1md2w6GJiXzsUKzBXJmJNBA
提取码:1dj7
2. 通过rpm方式安装jdk
[root@localhost tempfile]# rpm -ivh jdk-8u211-linux-x64.rpm
3. 安装完成后通过java -version命令查看是否安装成功
[root@localhost tempfile]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)