2 @REM Copyright (C) 2018 ZTE, Inc. and others. All rights reserved. (ZTE)
4 @REM Licensed under the Apache License, Version 2.0 (the "License");
5 @REM you may not use this file except in compliance with the License.
6 @REM You may obtain a copy of the License at
8 @REM http://www.apache.org/licenses/LICENSE-2.0
10 @REM Unless required by applicable law or agreed to in writing, software
11 @REM distributed under the License is distributed on an "AS IS" BASIS,
12 @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 @REM See the License for the specific language governing permissions and
14 @REM limitations under the License.
21 echo ### RUNHOME: %RUNHOME%
23 if exist "%RUNHOME%setenv.bat" (
24 call "%RUNHOME%setenv.bat"
28 echo ================== ENV_INFO =============================================
29 echo RUNHOME=%RUNHOME%
30 echo JAVA_BASE=%JAVA_BASE%
31 echo Main_Class=%Main_Class%
32 echo APP_INFO=%APP_INFO%
33 echo Main_JAR=%Main_JAR%
34 echo Main_Conf=%Main_Conf%
35 echo ==========================================================================
38 echo ### Starting %APP_INFO%
40 IF EXIST "%JAVA_BASE%" (
41 set JAVA_HOME=%JAVA_BASE%
44 set JAVA="%JAVA_HOME%/bin/java"
45 set JAVA_OPTS=-Xms50m -Xmx128m
48 setlocal enabledelayedexpansion
50 FOR /F "tokens=3 delims= " %%a in ('"%JAVA% -version 2>&1"')do (
51 if !index! equ 1 set JAVA_VERSION=%%a
54 set JAVA_VERSION=%JAVA_VERSION:~1,3%
55 if "%JAVA_VERSION%"=="1.8" (
56 set jvm_opts=-Xms16m -Xmx128m -XX:+UseSerialGC -XX:MaxMetaspaceSize=64m -XX:NewRatio=2
58 set jvm_opts=-Xms16m -Xmx128m -XX:+UseSerialGC -XX:MaxPermSize=64m -XX:NewRatio=2
61 set jvm_opts=%jvm_opts% -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=%port%,server=y,suspend=n
63 set CLASS_PATH=%RUNHOME%;%RUNHOME%%Main_JAR%
66 echo ================== RUN_INFO =============================================
67 echo ### JAVA_HOME: %JAVA_HOME%
69 echo ### jvm_opts: %jvm_opts%
70 echo ### class_path: %CLASS_PATH%
71 echo ### EXT_DIRS: %EXT_DIRS%
72 echo ==========================================================================
78 %JAVA% -classpath %CLASS_PATH% %jvm_opts% %Main_Class% server %RUNHOME%/%Main_Conf%
80 IF ERRORLEVEL 1 goto showerror
83 echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!
84 echo After checking, press any key to close