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