On Windows OS without Service.
start.bat
@ECHO OFF
call run.bat start
stop.bat:
@ECHO OFF
call run.bat stop
run.bat
@ECHO OFF
IF "%1"=="start" (
ECHO start myapp
start "myapp" java -jar -Dspring.profiles.active=staging myapp.jar
) ELSE IF "%1"=="stop" (
ECHO stop myapp
TASKKILL /FI "WINDOWTITLE eq myapp"
) ELSE (
ECHO please, use "run.bat start" or "run.bat stop"
)
pause