| 12345678910111213141516171819202122232425262728293031323334 |
- @echo off
- chcp 65001
- :: Get the directory of the script
- for %%I in ("%~dp0.") do set "SCRIPT_DIR=%%~fI"
- :: Change directory to the parent directory of the script
- cd /d "%SCRIPT_DIR%\.."
- :: Check if Java is installed
- set "javaPath=D:\windows\app\Java\jdk-17.0.8\bin\java.exe"
- REM set "javaPath=java"
- %javaPath% -version >nul 2>&1
- if errorlevel 1 (
- echo Java is not installed or not found.
- echo Please install Java and try again.
- exit /b 1
- )
- if not exist "train-server.jar" (
- echo The file train-server.jar does not exist.
- exit /b 1
- )
- if not exist "./conf/application.yml" (
- echo The file config/application.yml does not exist.
- exit /b 1
- )
- if not exist "lib" (
- echo The directory lib does not exist.
- exit /b 1
- )
- :: rest of your script
- %javaPath% -Djava.security.egd=file:/dev/./urandom -Dloader.path=./lib -jar train-server.jar --spring.config.location=./conf/application.yml
- pause
|