How to make a Java app automatically start when PC starts?
I'm developing a scheduling app, i开发者_开发问答t reminds user of things to do during a day, it checks every minute to see if time is up, and if it is it will open an alert window to remind the user. Although it's written in Java, I'm targeting Windows users for this app. It needs to run as soon as users' PCs are turned on, so my question is: How to make a Java app automatically start when a PC is turned on in a Windows system?
I know I can go through a few steps manually to add the app to start-up apps list, but not every user is familiar with the steps, so I wonder if it can do this through my Java program, and if so is there any sample code?
create a .bat file
@javaw -jar path/to/jar/Name.jar arguments
drop this in you startup directory
Use Java Service Wrapper. Set wrapper.ntservice.starttype=DEMAND_START
in wrapper configuration.
精彩评论