Files
electron-4/resources/java/start.bat
2025-09-11 18:27:56 +08:00

30 lines
820 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
chcp 65001 > nul
set "CURRENT_DIR=%~dp0"
:: 核心路径配置
set "JAVA_HOME=%CURRENT_DIR%jdk"
set "APP_DIR=%CURRENT_DIR%app"
set "JAR_PATH=%APP_DIR%\yjearth.jar"
set "CONFIG_PATH=%APP_DIR%\application.yml"
:: 关键文件检查
if not exist "%JAVA_HOME%\bin\java.exe" (
echo 错误未找到Java%JAVA_HOME%\bin\java.exe
pause && exit /b 1
)
if not exist "%APP_DIR%" (
echo 错误未找到app目录%APP_DIR%
pause && exit /b 1
)
if not exist "%JAR_PATH%" (
echo 错误未找到yjearth.jar%JAR_PATH%
pause && exit /b 1
)
if not exist "%CONFIG_PATH%" (
echo 警告未找到application.yml%CONFIG_PATH%
)
:: 启动应用
cd /d "%APP_DIR%"
"%JAVA_HOME%\bin\java.exe" -Dfile.encoding=UTF-8 -jar "%JAR_PATH%" --spring.config.location="%CONFIG_PATH%"