配置hadoop要指向JDK路径,所以不推荐使用opendJDK
1 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz
2 sudo tar zxvf jdk-7u67-linux-x64.tar.gz -C /opt/
3 cat > /etc/profile.d/java.sh <<EOF
#!/bin/bash
export JAVA_HOME=/opt/jdk1.7.0_67
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
4 rpm -qa|grep jdk查看当前JDK版本
5 rpm -qa|grep jdk|xargs rpm -e --nodeps 删除Linux自带openJDK
6 source /etc/profile.d/java.sh 然后 java -version检查
1 wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7u67-linux-x64.tar.gz
2 sudo tar zxvf jdk-7u67-linux-x64.tar.gz -C /opt/
3 cat > /etc/profile.d/java.sh <<EOF
#!/bin/bash
export JAVA_HOME=/opt/jdk1.7.0_67
export PATH=\$PATH:\$JAVA_HOME/bin
EOF
4 rpm -qa|grep jdk查看当前JDK版本
5 rpm -qa|grep jdk|xargs rpm -e --nodeps 删除Linux自带openJDK
6 source /etc/profile.d/java.sh 然后 java -version检查