上代码:
#!/bin/bash #Engine server install #Write by guojr #Set Engine server dir jdk=jdk-6u34-linux-x64-rpm.bin chmod o+x $jdk && echo -e "\n" | ./$jdk; ( cat <<EOF #set java environment JAVA_HOME=/usr/java/jdk1.6.0_34 CLASSPATH=.:$JAVA_HOME/lib.tools.jar PATH=$JAVA_HOME/bin:$PATH export JAVA_HOME CLASSPATH PATH EOF )>>/etc/profile; source /etc/profile;
echo -e "\n" | ./$jdk; 这个是最关键的一步跳过回车自动安装jdk