scp -P 4222 jdk-8u181-linux-x64.tar.gz root@xx.xxx.xx.xx:/usr/local/java/
复制其他服务器上jdk
tar -zxvf jdk-8u181-linux-x64.tar.gz
vim /etc/profile
修改配置
#set java enviroment
JAVA_HOME=/usr/local/java/jdk1.8.0_181
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
source /etc/profile刷新
java -version 查看jdk是否配置成功