0

How do i make my .jar file execute on startup because we have constant blackouts here and when the server starts up i want the server.jar to start as well.

Is there any simple way of doing this ?

1 Answer 1

1

Edit the /etc/rc.local file by doing:

sudo nano /etc/rc.local

And in there type

java -jar /path/to/your/file.jar

Make sure this goes BEFORE the 'exit 0'

7
  • Hi ive done this already, it does not work.
    – user294159
    Jun 26, 2014 at 14:00
  • does java -jar /path/to/your/file.jar normally work?
    – Mitch
    Jun 26, 2014 at 14:07
  • Yes, well the command i use while logged in with putty is nohup java -jar /path/to/file/file.jar & then it works perfectly fine.
    – user294159
    Jun 26, 2014 at 14:17
  • Try adding that exact command to the file, and see if that works for you
    – Mitch
    Jun 26, 2014 at 14:17
  • Also same result doesn't work, because its a basic network app so when i run the command it works but doesn't start up.
    – user294159
    Jun 26, 2014 at 14:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .