auto start Java program
I want to make auto star开发者_如何学编程t Java program in such a way that its start up whenever client machine is booted.
This depends on the OS where you want to start your application.
For example if it's Windows you can make a .bat file containing command you can use to start you application from console, something like that:
java MainClassName
Depending on you application you may need to add parameters.
Further you can go to Autostart folder in Start Menu and create there shortcut to your .bat file. You should also specify the correct working folder in shortcut properties.
The answer depends on what OS you are using. Running program every time system starts is an OS job. Not Java. If you are using unix/linux, then, generally, you need to set up command line script using bash (or equivalent) as a wrapper to your program. On Windows... Just use the msconfig.
精彩评论