From 4e1eb66470db60a65ba2d65a927d2c7a1a256d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=AD=90=E6=9D=8E=C2=B7De?= Date: Sat, 24 Jul 2021 12:19:35 +0800 Subject: [PATCH] Update start.bat --- report-core/src/main/assembly/bin/start.bat | 46 ++++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/report-core/src/main/assembly/bin/start.bat b/report-core/src/main/assembly/bin/start.bat index 4bd56310..6f7c2f76 100755 --- a/report-core/src/main/assembly/bin/start.bat +++ b/report-core/src/main/assembly/bin/start.bat @@ -1,18 +1,42 @@ @echo off & setlocal enabledelayedexpansion -cd ..\lib - -for /f "delims=" %%i in ('dir /a-d /b /on aj-report*.jar') do ( - set BOOT_JAR=%%i +rem 判断cmd中是否有JAVA_HOME +rem set JAVA_HOME=D:\App\Java\jdk1.8.0_172 +IF "%JAVA_HOME%" == "" ( +echo end + goto END +) ELSE ( +echo start + goto START ) -for %%i in (*) do set LIB_JARS=!LIB_JARS!..\lib\%%i; -cd ..\bin -echo %LIB_JARS% -echo "" +:END + rem cmd中未找到JAVA_HOME,请在此启动文件中第4行指定,然后尝试 + echo Not JAVA_HOME Find, Please add JAVA_HOME in this file line 4 + pause + exit + +:START + cd ..\lib + + rem 查找aj-report*.jar启动文件,版本号每次会变 + for /f "delims=" %%i in ('dir /a-d /b /on aj-report*.jar') do ( + set BOOT_JAR=%%i + ) + echo %BOOT_JAR% + + rem 查找附加的驱动,加到java启动的classpath中 + for %%i in (*) do ( + if "%%i" neq "%BOOT_JAR%" ( + set LIB_JARS=!LIB_JARS!..\lib\%%i; + ) + ) + echo %LIB_JARS% -set JAVA_HOME=D:\App\Java\jdk1.8.0_172 -set JAVA_OPTS= -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k + rem 启动内存设置,请根据自己需要调整 + cd ..\bin + set JAVA_OPTS= -server -Xms1g -Xmx2g -Xmn256m -XX:PermSize=128m -Xss256k -%JAVA_HOME%\bin\java %JAVA_OPTS% -jar -Dspring.config.location=..\conf\bootstrap.yml ..\lib\%BOOT_JAR% -Xbootclasspath/a:%LIB_JARS% + rem 正式启动 + %JAVA_HOME%\bin\java %JAVA_OPTS% -jar -Dspring.config.location=..\conf\bootstrap.yml ..\lib\%BOOT_JAR% -Xbootclasspath/a:%LIB_JARS%