【问题标题】:How to check if a Tomcat service is running or stopped in windows through a Java program? [duplicate]如何通过Java程序检查Tomcat服务是否在Windows中运行或停止? [复制]
【发布时间】:2012-08-23 18:00:36
【问题描述】:

可能重复:
How to check if a service is running via batch file and start it, if it is not running?
Determine if Tomcat is running in Windows using the command prompt

有没有办法通过通过 Windows 调度程序运行的 Java 程序检查 Tomcat 服务(或与此相关的任何服务)是否在 Windows 操作系统中运行/停止?如果停止,我必须启动该服务吗?

【问题讨论】:

标签: java jakarta-ee tomcat process


【解决方案1】:

不确定 tomcat 进程是什么样的。如果它类似于 tomcat.exe,那么您可以使用问题中的解决方案来获取进程。 How to get a list of current open windows/process with Java? 然后搜索进程名

【讨论】:

    猜你喜欢
    • 2016-07-04
    • 2011-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-15
    • 2011-11-11
    • 2011-05-04
    • 1970-01-01
    相关资源
    最近更新 更多