If you really want it to run in the background, java -jar myapp.jar & will do the job. That way, he will still die when the shell closes, but you can continue to use your shell.
If you really want it to run as a daemon, nohup java -jar myapp.jar & will do the job. Thus, he will continue to live when the shell closes.
If you want this to be reliable, you can prepare an init script or definition for the upstart job, or run it via Vixie cron(8) @reboot so that it starts at boot time.
source share