install_jdk.sh
#!/bin/bash BASE_SERVER=mini03 yum install -y wget wget $BASE_SERVER/soft/jdk-7u45-linux-x64.tar.gz tar -zxvf jdk-7u45-linux-x64.tar.gz -C /usr/local cat >> /etc/profile << EOF export JAVA_HOME=/usr/local/jdk1.7.0_45 export PATH=\$PATH:\$JAVA_HOME/bin EOF source /etc/profile最后在mini03的~目录下执行./boot.sh安装即可,最后可以在每台机器上用java -version来查看