Run Embedded Jetty Server in Background on Linux

Hello,

I'm using a ssh session on a Linux server to start an Embedded Jetty Server to run a web application that exposes web services. When I use the java -jar start.jar to bring up the Jetty web server instance I don't have access to the command line in that session and must open up a new ssh session in order to run a command line application that invokes the web services running on the jetty instance. Is there any way to run jetty in the background and in the same ssh session have access to the command line?
cgray1223Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
legolasthehansyConnect With a Mentor Commented:
Try this,

If you are running the SSH session remotely,
nohup <java command> &

This runs the command in the background so that you can access the console/session for doing your work. Closing the session wouldn't terminate the program. If you want to terminate it you will need to find the process ID and send the KILL signal.
You can avoid all this and simply run,
<java command> & 
and it would terminate if you close the session.
0
 
cgray1223Author Commented:
I used java -jar start.jar &>/dev/null & but your solution would work as wel.
0
All Courses

From novice to tech pro — start learning today.