Solved

Run Embedded Jetty Server in Background on Linux

Posted on 2012-03-14
2
1,053 Views
Last Modified: 2012-03-15
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?
0
Comment
Question by:cgray1223
2 Comments
 
LVL 11

Accepted Solution

by:
legolasthehansy earned 500 total points
ID: 37726205
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
 

Author Comment

by:cgray1223
ID: 37727932
I used java -jar start.jar &>/dev/null & but your solution would work as wel.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now