问题:
I've just inherited a java application that needs to be installed as a service on XP and vista.我刚刚继承了一个需要在 XP 和 vista 上作为服务安装的 Java 应用程序。 It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j).自从我以任何形式使用 windows 以来已经大约 8 年了,而且我从来没有创建过服务,更不用说从类似 java 应用程序的东西中创建的了(我有一个应用程序的 jar 和一个依赖项 jar - log4j )。 What is the magic necessary to make this run as a service?使其作为服务运行所需的魔法是什么? I've got the source, so code modifications, though preferably avoided, are possible.我有源代码,所以代码修改,虽然最好避免,是可能的。
解决方案:
参考一: https://stackoom.com/question/Hib参考二: How to create a windows service from java app