@echo off
setlocal
cd /d "%~dp0"

if "%JAVA_HOME%"=="" (
  set "JAVA=java"
) else (
  set "JAVA=%JAVA_HOME%\bin\java.exe"
)

"%JAVA%" --version >nul 2>&1
if errorlevel 1 (
  echo Java 25 runtime not found. Set JAVA_HOME or add java to PATH.
  exit /b 1
)

"%JAVA%" --enable-native-access=ALL-UNNAMED -jar "%CD%\lib\palmorder-server.jar" --spring.config.additional-location="file:%CD%\config\application.yml" %*
