当前位置:网站首页>Win jar package setting boot auto start
Win jar package setting boot auto start
2022-06-12 00:38:00 【Loader】
We need to put jar Set to power on and auto start , therefore , Looking up some information , Yes 2 Type of implementation ,1 One is to jar Package registration as service ,2 Is to add a batch command under the Startup menu .
1, register jar For service
stay Windows Environment settings: startup and self startup jar The core idea of the package is to register the startup command as a service , Then you can set the boot auto start . It is troublesome to write a registration service code by hand , With the help of thread exe Executable files to do .
First download WinSW Software
Address :https://github.com/winsw/winsw/releases
Download the two files in the red box of the latest version .
Copy and paste these two files into jar The same directory as the package , Change to the same name , for example web-start etc. .
modify xml file
<service> <!-- ID of the service. It should be unique across the Windows system--> <id>web-start</id> <!-- Display name of the service --> <name>web-start</name> <!-- Service description --> <description> start-up web service </description> <!-- Path to the executable, which should be started --> <executable>java</executable> <arguments> -Dfile.encoding=UTF-8 -Dloader.path="lib/" -jar wms-0.0.1-SNAPSHOT.jar</arguments> </service>
Then open the cmd Command line window , Run the following command under this directory , If you see the following and return to the command input interface, the installation is successful
web-start.exe install
cmd window
Then find the service in the service
Then go to the service window to find the same id Service for , You can set it to automatic and start it .
After the startup is completed, a... Will be generated in the same directory web-start.err.log、web-start.out.log and web-start.wrapper.log, Corresponding to the error log 、 Enter log and exe Software log .
Sometimes it works this way jar The package does not have administrator privileges , Unable to access some files in the system , There are two ways :
The first is to right-click the corresponding service on the service page , attribute , Login tab , Change the login user to system administrator .
2, Put it under the Startup menu
Create a new text document , Use a text editor to write
@echo off start /b java -Dfile.encoding=UTF-8 -Dloader.path="lib/" -jar wms-0.0.1-SNAPSHOT.jar
Change the file name to start.bat,
create shortcut ,
Just put the shortcut in .
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
End !
Reprinted address :
https://blog.csdn.net/shenjuntao520/article/details/106490533
边栏推荐
- Explore table component virtualization
- 2023 spring recruit | ant group middleware Intern Recruitment
- Enterprise wechat H5_ Integrated message decryption class, message push get and post callback processing
- oracle使用Navicat工具导入导出数据
- How to strengthen the prevention and control of major safety risks for chemical and dangerous goods enterprises in flood season
- 2022 Tibet latest special worker (construction elevator) simulation test question bank and answers
- 干货|一次完整的性能测试,测试人员需要做什么?
- 設計消息隊列存儲消息數據的 MySQL 錶格
- ROS2之OpenCV基础代码对比foxy~galactic~humble
- Convert VOC data format to coco data format
猜你喜欢

Pycharm file name taboo

IP addressing overview

Explore table component virtualization

Exploration of qunar risk control safety products

How to strengthen the prevention and control of major safety risks for chemical and dangerous goods enterprises in flood season

Pleasant and burden free cross process communication

Devops landing practice drip and pit stepping records - (1)

R language spline curve piecewise linear regression model piecewise regression estimation of individual stock beta value analysis of yield data

环境搭建2

How to make scripts executable anywhere
随机推荐
Alibaba cloud intelligent coding plug-in provides a more cosy development experience
如何优化PlantUML流程图(时序图)
[industry application] an article on power digital transformation
月份选择器禁用当月以后的数据 包含当月
R language spline curve piecewise linear regression model piecewise regression estimation of individual stock beta value analysis of yield data
730.Count Different Palindromic Subsequences
How to make scripts executable anywhere
What are the advantages of Tiktok applet
The "hard words" about interface testing
gin解决跨域问题
Tencent programmer roast: 1kW real estate +1kw stock +300w cash, ready to retire at the age of 35
IP编址概述
Gin solves cross domain problems
ROS2之OpenCV基础代码对比foxy~galactic~humble
oracle使用Navicat工具导入导出数据
How to measure the app project? How to build a test system
SF14 | supertrend "super trend" indicator magic change and upgrade (source code)
Experiment four categories and objects
时间选择器样式错乱 中间文字被遮挡
App startup process: from clicking the application icon to the activity startup process