Skip to content
Advertisement

Running multiple Java Applications on startup

I currently run these java applications with the following command via root: java -Xms1G -Xmx1G -jar /var/www/tekkit.socialnetwk.com/tekkit.jar nogui

Although if I close the terminal window those applications close/stop. Is there anyway to stop this from happening? Either creating it as a service or to start it on boot. I’ve tried rc.local but no luck.

I’m running on Ubuntu – Newest.

Advertisement

Answer

In the past I have done two things to make a process run after the terminal shuts down… use ampersand to run it in the background and nohup so that it does not get killed by the terminal closing.

nohup java -Xms1G -Xmx1G -jar /var/www/tekkit.socialnetwk.com/tekkit.jar nogui &

EDIT: Here is a great answer that goes into detail. Upvote that answer instead since it is way more complete.

Advertisement