当前位置:网站首页>Register the jar package as a service to realize automatic startup after startup
Register the jar package as a service to realize automatic startup after startup
2022-06-25 09:08:00 【String-int】
1、 Use winsw

Download these two
1、 Put it in and jar Under the same directory of the package
2、 Rename the above two files to the service name ( You can get up , Just don't duplicate the service name on the computer )
3、 modify xml file ( There should be no Chinese in the notes when using )
<!-- This is the smallest Windows Service Wrapper Configuration example , Only mandatory options are included . This configuration file should be placed in WinSW Near the executable , Name should be the same . E、 g. about myapp.exe The profile name should be myapp.xml You can find more information about configuration options here :https://github.com/kohsuke/winsw/blob/master/doc/xmlConfigFile.md Complete example :https://github.com/kohsuke/winsw/blob/master/examples/sample-allOptions.xml -->
<service>
<!-- Service ID. It's all over the place Windows It should be unique in the system -->
<id>CacheMain</id>
<!-- Display name of the service -->
<name>CacheMainService</name>
<!-- The service description -->
<description>This service is a service created from a minimal configuration</description>
<!-- java environment variable -->
<env name="JAVA_HOME" value="%JAVA_HOME%"/>
<executable>java</executable>
<arguments>-jar "D:\workspace\practice\Cache\target\Cache - 1.0.1.jar" --xx</arguments>
<!-- Boot up -->
<startmode>Automatic</startmode>
</service>
1、<id> and <name> The contents in the tag suggest settings and exe and xml The file is the same , If I'm here Cache.exe and Cache.xml, So set to Cache and CacheService, Cannot have the same name as an existing service
2、<arguments> Label in quotation marks jar The package address and name need to be replaced with their own , If the startup command is not java -jar "xxx", It is java -jar "xxx" --xx, take --xx Just follow the quotation marks . Such as <arguments>-jar "C:\Windows\System32\cmd.exe\CollectionGrapthMap.jar" --xx</arguments>
3、 Installation services
stay exe The directory where it is executed CacheMain.exe install ,Cache Name self replacement , If you need to unload the input CacheMain.exe uninstall
4、 Start the service
win+r, Input services.msc, Find the service you just installed , Right click to start 
Be careful : One jar Packages can only be registered as one service
边栏推荐
- LVS-DR模式单网段案例
- Notes on key words in the original English work biography of jobs (VI) [chapter three]
- 《乔布斯传》英文原著重点词汇笔记(五)【 chapter three 】
- 4、 Convolution neural networks
- CSV parameterization in JMeter
- atguigu----01-脚手架
- 在华泰证券上面开户好不好,安不安全?
- 35 websites ICER must know
- The meshgrid() function in numpy
- Voiceprint Technology (VII): the future of voiceprint Technology
猜你喜欢

C#程序终止问题CLR20R3解决方法

Matplotlib axvline() and axhline() functions in Matplotlib

3大问题!Redis缓存异常及处理方案总结

C#启动程序传递参数丢失双引号,如何解决?

4、 Convolution neural networks
![[opencv] - input and output XML and yaml files](/img/4e/7944e205c71246d0b0e3747eefca37.png)
[opencv] - input and output XML and yaml files

Matplotlib decision boundary drawing function plot in Matplotlib_ decision_ Boundary and plt Detailed explanation of contour function

Nodejs using the express framework demo

matplotlib matplotlib中plt.axis()用法

声纹技术(六):声纹技术的其他应用
随机推荐
《乔布斯传》英文原著重点词汇笔记(二)【 chapter one】
Is it safe to open a stock account through the account opening QR code of the account manager? Or is it safe to open an account in a securities company?
WebGL谷歌提示内存不够(RuntimeError:memory access out of bounds,火狐提示索引超出界限(RuntimeError:index out of bounds)
《乔布斯传》英文原著重点词汇笔记(三)【 chapter one】
一、单个神经元网络构建
微服务调用组件Ribbon底层调用流程分析
C#程序终止问题CLR20R3解决方法
(翻译)采用字母间距提高全大写文本可读性的方式
Matplotlib plt grid()
C # startup program loses double quotation marks for parameters passed. How to solve it?
How to become a software testing expert? From 3K to 17k a month, what have I done?
atguigu----18-组件
打新债安全性有多高啊
2、 Training fashion_ MNIST dataset
Jmeter中的断言使用讲解
Analysis on the bottom calling process of micro service calling component ribbon
Atguigu---17-life cycle
(translation) the use of letter spacing to improve the readability of all capital text
Flitter gets the height of the top status bar
云网络技术的好处以及类型