如何從 Java 應用程序創建 Windows 服務 - How to create a windows service from java app

問題:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章