I want to make auto start Java program in such a way that its start up whenever client machine is booted.
Asked
Active
Viewed 1,737 times
0
-
3what kind of machine are you targeting ? The answer won't be the same for Windows and for Linux. – Valentin Rocher Dec 02 '10 at 11:54
-
2See http://stackoverflow.com/q/326509/141081 – Dirk Dec 02 '10 at 11:57
-
Do you need it to be a service? Or an application which is running when a user logs in? – Peter Lawrey Dec 02 '10 at 12:10
-
an application which is running when a user logs in – Zeel Dec 02 '10 at 12:21
2 Answers
0
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.

Running
- 1
- 1
0
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.

JohnGray
- 656
- 1
- 10
- 27