1、修改/etc/rc.d/rc.local
#vi/etc/rc.d/rc.local
2、在/etc/rc.d/rc.local文件最后添加两行脚本:
exportJAVA_HOME=/usr/local/jdk1.7.0_03 /usr/local/apache-tomcat-7.0.32/bin/startup.shstart
3、修改rc.local文件为可执行:
#chmod+xrc.local