Linux 启动 Java jar

Linux 启动 Java jar


1-start.sh

#!/bin/bash
JAVA_HOME=/usr/local/jdk1.8.0_144
JRE_HOME=/usr/local/jdk1.8.0_144/jre

CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

JVM="-Xms1024m -Xmx1024m"

nohup java -server -jar ${JVM} /home/access/access-0.0.1-SNAPSHOT.jar   >> /home/access/run.log 2>&1 & 

2-stop.sh

pid=`ps aux | grep consult | awk '!/awk/ && !/grep/ {print $2}'`
if [ "${pid}" != "" ]; then
   kill -9 ${pid};
  echo ${pid};
fi

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 创作都市 设计师:CSDN官方博客 返回首页