Rajeev
Rajeev

Reputation: 4839

How to run Java application at system startup on Windows/Linux/MacOS?

How I can run Java application at system startup on Windows/Linux/MacOS?

Any implementation of JNA/JNI shall be welcome.

Upvotes: 10

Views: 2791

Answers (4)

Vadzim
Vadzim

Reputation: 26170

Take a look at http://yajsw.sourceforge.net/. It's free and compatible reimplementation of TanukiSoftware Java Service Wrapper featuring free 64-bit support.

There is also a comparison table for YAJSW, JSW, ACD and L4J.

Upvotes: 2

Pierre
Pierre

Reputation: 1367

Take a look at http://wrapper.tanukisoftware.org. It provides a wrapper for java applications to run under the various operating systems. You can use the community edition.

Upvotes: 4

bLuE
bLuE

Reputation: 41

On windows you can use reg add Add the path of your application to hklm/software/microsoft/windows/current version/run To see more ,on command prompt type reg add /? Alternatively yo can use system call to add it from your application itself

Upvotes: 3

Agemen
Agemen

Reputation: 1535

You can consider your application as a service under linux, and add a script that could start it under /etc/init.d (on most distributions, I think). You'll then have to make the needed links to the runlevel folders, to decide when to run your application. I think you can use chkconfig too

A basic example of script can be found here

I don't have most clues for the other two systems, however.

Upvotes: 3

Related Questions