这篇文章将为大家详细讲解有关MSF4J微服务如何配置jar包直接启动,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
DIRNAME=`dirname $0`
PROGNAME=`basename $0`
echo "$DIRNAME-$PROGNAME"
INSTANCE_NAME=robot-1.0-SNAPSHOT
JDK=""
if [ "x$JAVA" = "x" ]; then
if [ "x$JAVA_HOME" = "x" ]; then
if [ "$PLAT" = "HP-UX" ]; then
JDK="/opt/java1.5"
fi
if [ "$PLAT" = "AIX" ]; then
JDK="/usr/java5"
fi
if [ "$PLAT" = "Linux" ]; then
JDK="/usr/java/jdk1.5.0_17"
fi
if [ "$PLAT" = "SunOS" ]; then
JDK="/usr/java/jdk1.5.0_17"
fi
if [ "x$JDK" != "x" ]; then
JAVA_HOME=$JDK
JAVA="$JAVA_HOME/bin/java"
fi
else
JAVA="java"
fi
fi
echo " JAVA_HOME=$JAVA_HOME"
# Setup the classpath
HD_PD=`pwd`
runjar="$HD_PD/$INSTANCE_NAME.jar"
if [ ! -f $runjar ]; then
die "Missing required file: $runjar"
fi
CLASSPATH=".:$HD_PD:$runjar"
echo "CLASSPATH=$CLASSPATH"
JAVA_OPTS=”-server -Dfile.encoding=UTF-8 -Xms2048m -Xmx2048m -XX:PermSize=1024M -XX:MaxPermSize=1024m -verbose:gc -Xloggc:$HD_PD/logs/gc.log`date +%Y-%m-%d-%H-%M` -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -noclassgc -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$HD_PD/dump”
#debug 开发工具远程调试
#java $JAVA_MEM_OPTS -agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y -jar $runjar > start.log &
nohup java -jar $JAVA_OPTS $runjar &
echo "robotMain Program running start!"
ps -ef|grep $runjar
关于“MSF4J微服务如何配置jar包直接启动”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。