1.从下面地址下载所要的文件:
https://github.com/kohsuke/winsw/releases
2.下载下图所示的两个文件:
3.可以重命名和jar包名保持一致,三个文件放在同一个目录
4.修改.xml文件:
<configuration>
<!-- ID of the service. It should be unique accross the Windows system-->
<id>work</id>
<!-- Display name of the service -->
<name>work</name>
<!-- Service description -->
<description>统一支撑平台</description>
<executable>java</executable>
<arguments>-jar work.jar</arguments>
</configuration>
4.安装服务,cmd命令行进入当前目录
work.exe install
5.启动服务
net start work