How to create a service for ubuntu to run java code for auto-launch at reboot?
Posted on 2011-05-11
I got a ubundu desktop. I would like to start a java program at reboot.
I put some lines in rc.local like
#run_code is a java class
#export command is needed
#cd command to change directory before launching is needed
After reboot without user login, java code is not up and running yet.
(java code is a network application and I cannot communicate with
java code if it's not running.) But after login, java code is running.
I'm thinking to use service for auto-launch instead of rc.local. But
I need help on that task. And the main issue to launch my java code
automatically at machine reboot without login. Other ways to accomplish
that purpose are fine, too.
All suggestions are appreciated.