java jar 注册成 windows 服务
作者:互联网
1、去github上下载winsw
https://github.com/winsw/winsw/releases
2、WinSW.NET4.xml
<service> <id>javaService</id> <name>java服务</name> <description>java服务</description> <!-- java环境变量 --> <!--<env name="JAVA_HOME" value="%JAVA_HOME%"/>--> <executable>java</executable> <arguments>-Dspring.config.location=application.properties -jar tube4api-1.0.0.jar</arguments> <!-- 开机启动 --> <startmode>Automatic</startmode> <!-- 日志配置 --> <logpath>d:\log\javaService</logpath> <logmode>rotate</logmode> </service>View Code
3、命令行定位到当前目录,执行
WinSW.NET4.exe install
4、去windows服务列表中启动程序
5、第3、4步骤也可以使用ViewService.exe程序来新建windows服务
标签:java,windows,jar,winsw,服务,NET4 来源: https://www.cnblogs.com/s0611163/p/15597513.html