jar部署启动bat
程序员文章站
2022-04-07 18:25:43
startup.bat@echo offif not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! & EXIT /B 1set "JAVA=%JAVA_HOME%\bin\java.exe"setlocal enabledelayedexpansion....
startup.bat
@echo off
if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! & EXIT /B 1
set "JAVA=%JAVA_HOME%\bin\java.exe"
setlocal enabledelayedexpansion
set BASE_DIR=%~dp0
set MODE="standalone"
set FUNCTION_MODE="all"
set MODE_INDEX=-1
set FUNCTION_MODE_INDEX=-1
set SERVICE_NAME=API_Service
set "JAVA_OPT=%JAVA_OPT% -server -Xms512m -Xmx512m -Xmn256m"
set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages"
set "JAVA_OPT=%JAVA_OPT% -Dfile.encoding=UTF-8"
set "JAVA_OPT=%JAVA_OPT% -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider"
set "JAVA_OPT=%JAVA_OPT% -Duser.home=UserHome"
set "JAVA_OPT=%JAVA_OPT% -Dspring.config.location=..\config\application.yml"
::set "JAVA_OPT=%JAVA_OPT% -Dlogback.configurationFile=..\config\logback.xml"
echo Starting %SERVICE_NAME%...
echo Please check log file in ./log/%SERVICE_NAME%.log for more information
title %SERVICE_NAME%
call "%JAVA%" %JAVA_OPT% -jar %BASE_DIR%\lib\web-1.0.0-exec.jar -> ..\log\%SERVICE_NAME%.log %SERVICE_NAME%%*
目录结构
root
-- bin
-- lib
-- startup.bat
-- config
-- log
本文地址:https://blog.csdn.net/SakeOfWhat/article/details/110289661