[英]How to add start/stop functionality to a Java application for registering as a service
We are writing an application in Java and it needs to be start/stoppable by another application, like a service/daemon. 我们正在用Java编写应用程序,它需要由其他应用程序(例如服务/守护程序)启动/停止。 We package it in a .jar which encapsulates everything it needs to run, and put it in a "working directory" which contains configuration files, variable resources, logs, etc. 我们将其打包在一个.jar文件中,该文件封装了它需要运行的所有内容,并将其放在包含配置文件,可变资源,日志等的“工作目录”中。
Is there a good way to be able to start/stop this application from a script or any other application by calling something on it? 是否可以通过调用脚本或其他任何应用程序来启动/停止该应用程序?
Thank you very much for any help! 非常感谢您的帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.