1、多种安装形式自己选择rpm、yum,压缩包形式
2、安装:
yum -y install oracle-j2sdk1.8.x86_64
3、配置环境变量
echo "" >> /etc/profile;
echo "#set Java environment" >> /etc/profile;
echo "export JAVA_HOME=/usr/java/jdk1.8.0_181-cloudera" >> /etc/profile;
echo "export JRE_HOME=$JAVA_HOME/jre" >> /etc/profile;
echo "export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH" >> /etc/profile;
echo "export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH" >> /etc/profile;
source /etc/profile
4、同步到其他服务器
cd ~/scripts/;
sh ./ssh_to_all_node.sh "yum -y install oracle-j2sdk1.8.x86_64"
sh ./sync_to_all_node.sh /etc/profile /etc/;
sh ./ssh_to_all_node.sh "source /etc/profile";
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)