jar註冊爲win服務

方法一:使用WinSW工具

工具地址:https://link.jianshu.com/?t=https://github.com/kohsuke/winsw/releases

參考:https://blog.csdn.net/wgd930701/article/details/123640481

方法二:藉助命令添加服務

1 創建bat文件

D:\tool\ddns\myddns.bat:
1 @echo off
2 D:
3 cd D:\tool\ddns
4 ping -n 10 127.0.0.1>nul
5 java -jar AliDDNS.jar

2 添加到服務

sc create myddns binPath=D:\tool\ddns\myddns.bat start=auto

 

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