How to install a Java application as a service

I have a Java application written that transfers the selected files to an ssh server. I want this application to start automatically every time Windows starts.

I know that this question has been asked several times, and I have followed these findings. I tried Java Service Wrapper (which is no longer available due to a DNS problem), Apache Daemon and JSL. Although I sometimes had to install the application as a service, I could never get it to work normally at boot time, or even start it manually from the command line.

My question is whether anyone knows about the first first step in the final tutorial on how to make this work. I came across several things, but all of them either assume that you have implemented what they do not explain how to implement, or rely on applications that I have not installed.

thanks

+1
source share
1 answer

I use Java Service Wrapper to install as windows or linux service: http://wrapper.tanukisoftware.com/doc/english/download.jsp

~> create one executable JAR for your application.

~> Download the proper service shell (they are different from windows and Linux)

~> Configure the service in the wrapper.conf file

Important: install wrapper.java.classpath correctly (your jar should be here too) Install wrapper.java.mainclass using org.tanukisoftware.wrapper.WrapperSimpleApp
Install wrapper.app.parameter.1 with the name of your main class, for example:

 wrapper.app.parameter.1=Main 

~> Check the service as a console (windows bat)

+6
source

Source: https://habr.com/ru/post/914951/


All Articles