#!/bin/bash
jar_name = ##you jar name##
nohup java -jar $jar_name --spring.config.location=application.properties > jar_log.log 2>&1 &
tail -f ./jar_log.log
#!/bin/bash
jar_name = ##you jar name##
PID=$(ps -ef | grep $jar_name ?| grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
echo $jar_name Application is already stopped
else
echo kill -9 $PID
kill -9 $PID
fi
#!/bin/sh
jar_name = ##you jar name##
echo $jar_name
pid=$(ps -ef | grep $jar_name | grep -v grep | grep -v /bin/sh | awk '{ print $2 }')
echo $pid
if [ -z "$pid" ]
then
echo $jar_name Application is already stopped
else
echo kill $pid
kill -9 ${pid}
fi
echo Starting application
echo "nohup java -Xms256M -Xmx256M -XX:PermSize=64M -XX:MaxPermSize=128M -jar ${jar_name} >jar_log.log 2>&1 &"
nohup java -Xms256M -Xmx256M -XX:PermSize=64M -XX:MaxPermSize=128M -jar ${jar_name} >jar_log.log 2>&1 &
tail -f ./jar_log.log