CentOS部署JDK
- 准备JDK,并上传到Linux环境
链接:https://pan.baidu.com/s/18W5TETRxOvLTafXczkUmpg
提取码:zkq5
- 解压安装包到/usr/java目录
[root@hadoop001 opt]# mkdir /usr/java
[root@hadoop001 opt]# tar -zxvf jdk-8u45-linux-x64.gz -C /usr/java
3. 修改jdk目录权限
[root@hadoop001 java]# chown root:root jdk1.8.0_45/
- 配置环境变量
[root@hadoop001 java]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_45
export PATH=${JAVA_HOME}/bin:$PATH
- source /etc/profile
[root@hadoop001 java]# source /etc/profile
[root@hadoop001 java]# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)