2 # Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
21 RUNHOME=`cd $DIRNAME/; pwd`
22 echo @RUNHOME@ $RUNHOME
24 if [ -f "$RUNHOME/setenv.sh" ]; then
25 . "$RUNHOME/setenv.sh"
27 echo "can not found $RUNHOME/setenv.sh"
30 echo ================== ENV_INFO =============================================
31 echo @RUNHOME@ $RUNHOME
32 echo @JAVA_HOME@ $JAVA_HOME
33 echo @Main_Class@ $Main_Class
34 echo @APP_INFO@ $APP_INFO
35 echo @Main_JAR@ $Main_JAR
36 echo @Main_Conf@ $Main_Conf
37 echo ==========================================================================
39 echo start $APP_INFO ...
41 JAVA="$JAVA_HOME/bin/java"
43 JAVA_VERSION=`$JAVA -version 2>&1 |awk 'NR==1{ sub(/"/,""); print substr($3,1,3)}'`
44 echo @JAVA_VERSION@ $JAVA_VERSION
45 if [ $JAVA_VERSION = "1.8" ]
47 JAVA_OPTS="-Xms16m -Xmx128m -XX:+UseSerialGC -XX:MaxMetaspaceSize=64m -XX:NewRatio=2"
49 JAVA_OPTS="-Xms16m -Xmx128m -XX:+UseSerialGC -XX:MaxPermSize=64m -XX:NewRatio=2"
52 JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$RUNHOME/../apiroute-works/logs/dump-msb-$(date +%Y%m%d%H%M%S).hprof"
54 #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n"
56 CLASS_PATH="$RUNHOME/:$RUNHOME/$Main_JAR"
58 echo ================== RUN_INFO =============================================
59 echo @JAVA_HOME@ $JAVA_HOME
61 echo @JAVA_OPTS@ $JAVA_OPTS
62 echo @CLASS_PATH@ $CLASS_PATH
63 echo @EXT_DIRS@ $EXT_DIRS
64 echo ==========================================================================
68 "$JAVA" $JAVA_OPTS -classpath "$CLASS_PATH" $Main_Class server "$RUNHOME/$Main_Conf"