Java learning: Windows system deploy jar package and deploy window service

This article mainly completes the process of completing the jar package deployment on the windows server and installing it into a service:
1. Package it into a jar package, as shown in the figure: You
Insert picture description here
need to use the startSmartIsv.bat batch file, winisv.exe, winisv.xml configuration file to create the service
winisv. xml configuration content:

<service>
	<id>Smart-isv</id>
	<name>Smart-isv</name>
	<description>6010 钉钉基础数据同步程序 </description>
	<logpath>%BASE%\logs</logpath>
	<log mode="roll-by-size">
		<sizeThreshold>10240</sizeThreshold>
		<keepFiles>8</keepFiles>
	</log>
	<executable>%BASE%\startSmartIsv.bat</executable>
	
</service>

StartSmartIsv.bat configuration content:

@echo off  
title smart-isv 6010
set path=C:\Program Files\Java\jdk1.8.0_201\bin
java -Djava.io.tmpdir=F:\smart-isv\data -Xms512m -Xmx1024m -jar smart-isv.jar

After the configuration file is ready, open the location of the file and run cmd as an administrator:
execute the installation service command: winisv.exe install
Insert picture description here
then you can view the created service in the service:
Insert picture description here
delete the service: the winisv.exe uninstall
jar deployment service has been completed, and only need to modify the jar Restart the service after covering.

Guess you like

Origin blog.csdn.net/weixin_41812784/article/details/111697498