Determine if Tomcat is running in Windows using the command prompt

后端 未结 10 1747
陌清茗
陌清茗 2020-12-15 06:24

Quite simply, how does one determine whether or not Tomcat is running in Windows, using the command prompt?

I am writing a batch script that must do this. This is

10条回答
  •  甜味超标
    2020-12-15 07:06

    Well, I am not very good with scripts but perhaps you could use this as a starting point:

    netstat -a -n | findstr :8005

    To get if someone is listening in port 8005. That is Tomcat's default port for remote administration, i.e. startup or shutdown.
    Alternatively you could use the port that the http server listens to.
    Hope this helps

提交回复
热议问题