一、准备工具
- yum源挂载已就绪;CentOS7本地yum源挂载。
- jdk-8u201-linux-x64.tar.gz,JDK安装包;
- 注意:在Linux配置JDK版本要求_jdk1.8+;
二、卸载CentOS7自带的OpenJDK
三、安装OracleJDK;
- 使用Xshell等工具将压缩包上传到Linux,并解压JDK源码包;

- 将解压后的文件移动到本地安装目录;
![AC@_6]65]7IWGM`4(Z`T1FK AC@_6]65]7IWGM`4(Z`T1FK](/image/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTQ2OTE3Ni8yMDE5MDMvMTQ2OTE3Ni0yMDE5MDMyNjAyMjc1OTg1NS0xMTY3NTA1ODQ5LnBuZw==.png)
- 添加环境变量,并使生效;
![G5@Z)PE5})(L]JRN4V%]QTT G5@Z)PE5})(L]JRN4V%]QTT](/image/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTQ2OTE3Ni8yMDE5MDMvMTQ2OTE3Ni0yMDE5MDMyNjAyMjgwMTA2Ny0xMjI1NjEwMDM1LnBuZw==.png)
- 验证JDK安装是否成功,切换到普通用户下,刷新环境变量;
![C2A1V~$P2KLJV_D4K]@(A`X C2A1V~$P2KLJV_D4K]@(A`X](/image/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTQ2OTE3Ni8yMDE5MDMvMTQ2OTE3Ni0yMDE5MDMyNjAyMjgwMjc4MS0xNzE2MjY3MDIwLnBuZw==.png)
- 查看Java版本能得出如上图所示的结果,表明OracleJDK安装成功;
export JAVA_HOME=/usr/local/jdk
export PATH=$PATH:$JAVA_HOME/bin

![L}6O{{PP]IHT2IF@B]]VS@P L}6O{{PP]IHT2IF@B]]VS@P](/image/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTQ2OTE3Ni8yMDE5MDMvMTQ2OTE3Ni0yMDE5MDMyNjAyMjc1NDc1Ni0xNzM2MTY1NDE3LnBuZw==.png)


