start.bat 919 B

12345678910111213141516171819202122232425262728293031323334
  1. @echo off
  2. chcp 65001
  3. :: Get the directory of the script
  4. for %%I in ("%~dp0.") do set "SCRIPT_DIR=%%~fI"
  5. :: Change directory to the parent directory of the script
  6. cd /d "%SCRIPT_DIR%\.."
  7. :: Check if Java is installed
  8. set "javaPath=D:\windows\app\Java\jdk-17.0.8\bin\java.exe"
  9. REM set "javaPath=java"
  10. %javaPath% -version >nul 2>&1
  11. if errorlevel 1 (
  12. echo Java is not installed or not found.
  13. echo Please install Java and try again.
  14. exit /b 1
  15. )
  16. if not exist "train-server.jar" (
  17. echo The file train-server.jar does not exist.
  18. exit /b 1
  19. )
  20. if not exist "./conf/application.yml" (
  21. echo The file config/application.yml does not exist.
  22. exit /b 1
  23. )
  24. if not exist "lib" (
  25. echo The directory lib does not exist.
  26. exit /b 1
  27. )
  28. :: rest of your script
  29. %javaPath% -Djava.security.egd=file:/dev/./urandom -Dloader.path=./lib -jar train-server.jar --spring.config.location=./conf/application.yml
  30. pause