SERVER=/home/lytz/zhengzy/myapp_email
cd $SERVER
start(){
echo "start project..."
JAVA_HOME=/usr/java/jdk1.7.0_79
export JAVA_HOME
PATH=$JAVA_HOME/bin:.:$PATH
export PATH
cd /home/lytz/zhengzy/myapp_email
#cd ../app/3-trade_service
classPath="./myapp_email.jar:./lib/mail.jar:./lib/ojdbc5.jar"
nohup java -Dfile.encoding=utf-8 -cp $classPath -Djava.security.policy=email_server-security.policy com.lytz.ServerStart &
echo $! > $SERVER/server.pid
echo "start project end..."
}
stop(){
echo "stop project..."
kill `cat $SERVER/server.pid`
rm -rf $SERVER/server.pid
echo "stop project end..."
}
restart(){
stop
sleep 1
start
}
echo "User Command: {start:1|stop:2|restart:3}"
read aNum
case $aNum in
1)
start
;;
2)
stop
;;
3)
restart
;;
*) echo 'You do not select a number between 1 to 3'
;;
esac
exit 1
linux下shell脚本启动java程序jar包
最新推荐文章于 2024-09-20 11:34:58 发布