2、安装JDK
http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
- 将Java安装到/usr/local/jdk1.8.0_121
tar -xvzf jdk-8u131-linux-x64.tar.gz -C /usr/local
- 设置环境变量,添加以下内容到/etc/profile末尾
export JAVA_HOME=/usr/local/jdk1.8.0_121
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin
scp -r /usr/local/jdk1.8.0_121/ root@node2:/usr/local/
scp -r /usr/local/jdk1.8.0_121/ root@node3:/usr/local/
scp -r /usr/local/jdk1.8.0_121/ root@node4:/usr/local/
scp -r /usr/local/jdk1.8.0_121/ root@node5:/usr/local/
scp -r /usr/local/jdk1.8.0_121/ root@node6:/usr/local/
scp /etc/profile root@node2:/etc/
scp /etc/profile root@node3:/etc/
scp /etc/profile root@node4:/etc/
scp /etc/profile root@node5:/etc/
scp /etc/profile root@node6:/etc/
source /etc/profile
java -version