Windows注册jar服务


一、 将java jar包和下载的WinSW.NET4.exe放在同一个文件夹目录下

二、 重命名WinSW.NET4.exe为shiro.exe

三、编辑shiro.xml文件

<configuration>
    <id>shiro</id>
    <name>shiro</name>
    <description>This is shiro</description>
    
    <executable>java</executable>
    <arguments>-jar shiro.jar</arguments>
    <!-- 开机启动 -->
    <startmode>Automatic</startmode>
    <logpath>logs</logpath>
    <log mode="roll-by-time">
        <pattern>yyyyMMdd</pattern>
    </log>
</configuration>

四、执行以下cmd命令

  • 注册服务:shiro.exe install

  • 启动命令: net start shiro

  • 停止命令:net stop shiro

  • 删除命令: sc delete shiro


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM