How to force a Java application to start automatically when a PC starts?

I am developing a planning application, it reminds the user of what needs to be done during the day, he checks every minute whether the time will rise, and if it opens, a warning window will appear to remind the user. Although it is written in Java, I am targeting Windows users for this application. It should start immediately after turning on the users PC, so my question is: how to get the Java application to start automatically when the computer is turned on in Windows?

I know that I can manually perform several steps to add an application to the list of running applications, but not every user is familiar with these steps, so I wonder if he can do this through my Java program, and if so, is there any Any sample code?

+4
source share
2 answers

create a .bat file

@javaw -jar path/to/jar/Name.jar arguments 

drop it in the startup directory

+2
source

Use Java Wrapper . Set wrapper.ntservice.starttype=DEMAND_START to the wrapper configuration .

+2
source

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


All Articles