Windows部署jar程序

一:windows上通过批处理启动 jar包并生成启动日志文件

创建.bat脚本文件

springboot.bat

@echo off
%1 mshta vbscript:CreateObject("WScript.Shell").Run("%~s0 ::",0,FALSE)(window.close)&&exit
java -jar springboot.jar>StartupLog.log 2>&1 &
exit

二:关闭启动的服务

  • 根据端口号查看pid
    • netstat -ano | findstr "8080"
    • netstat -ano | findstr 0.0.0.0:8080
  • 强制杀死进程
    • taskkill /f /pid 10212
    • taskkill -F -PID 10212

三:查看所有java进程

wmic process where caption="java.exe" get processid,caption,commandline /value

posted @ 2020-08-28 14:46  hellsino  阅读(2156)  评论(0)    收藏  举报