1.下載jar包
https://github.com/kohsuke/winsw
2.重命名
文章來源:http://www.zghlxwxcb.cn/news/detail-505740.html
3. 編輯xml文件
<configuration>
<id>MyApp</id>
<name>MyApp</name>
<description>This is MyApp.</description>
<executable>java</executable>
<arguments>-jar C:\Users\tanhw119214\Desktop\MyApp\MyApp.jar</arguments>
<!-- 開機(jī)啟動 -->
<startmode>Automatic</startmode>
<logpath>C:\Users\tanhw119214\Desktop\MyApp\logs</logpath>
<log mode="roll-by-time">
<pattern>yyyyMMdd</pattern>
</log>
</configuration>
4.啟動
MyApp.exe install
啟動命令
net start MyApp
停止命令
net stop MyApp
卸載命令
sc delete MyApp``
5.驗證
win+R 輸入 services.msc 即可查看文章來源地址http://www.zghlxwxcb.cn/news/detail-505740.html
到了這里,關(guān)于Windows服務(wù)器部署項目自啟動的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!