@echo off
title zhmes-agecal-admin
chcp 65001 > nul

setlocal

set "APP_HOME=%~dp0.."
set "APP_NAME=zhmes-agecal-3.5.0.jar"
set "JAVA_OPTS=-Xms1024m -Xmx2048m -Dfile.encoding=UTF-8"
set "SPRING_OPTS=--spring.config.location=../conf/application.yml"

echo Starting %APP_NAME% ...
echo JAVA_OPTS: %JAVA_OPTS%
echo SPRING_OPTS: %SPRING_OPTS%

cd /d "%APP_HOME%"

java %JAVA_OPTS% -jar "lib/%APP_NAME%" %SPRING_OPTS%

if %ERRORLEVEL% NEQ 0 (
    echo Failed to start %APP_NAME%
    pause
)

endlocal