环境搭建_jar包部署成本地服务(Windows)
实验环境:windows server2008R2 、windows10 一、下载winws.exe和winws.xml 下载地址:https://github.com/kohsuke/winsw/releases 下载红色处:
把exe文件、xml文件以及要打包成服务的jar包使用同名,方便管理
二、编辑auth-admin配置文件:
<configuration> <!-- ID of the service. It should be unique accross the Windows system--> <id>auth-admin</id> <!-- Display name of the service --> <name>auth-admin</name> <!-- Service description --> <description>统一支撑平台</description> <executable>java</executable> <arguments>-jar auth-admin.jar</arguments> </configuration>
三、cmd命令行进入当前目录 打包成服务:
auth-admin.exe install
卸载服务:
auth-admin.exe uninstall
启动服务:
auth-admin.exe start
关闭服务:
auth-admin.exe stop
重启服务:
auth-admin.exe restart
查看状态:
auth-admin.exe status
脚本启动:
cd C:UsersAdministratorDesktopserviceauth-admin auth-admin.exe stop auth-admin.exe uninstall auth-admin.exe install auth-admin.exe start
下一篇:
JAVA面向对象是什么?