Question

If you are doing local development I want to know how we can stop/kill Jetty webserver? I have to close my Eclipse IDE whenever I need to do that. Is there any other way to do it? Or we have to kill the process?

Thanks.

Was it helpful?

Solution

You should see Jetty instance(s) running in one of the Console. Just press the Red Button.

OTHER TIPS

Jetty can be stopped in the following ways:

  • You can click the "red" button in the Eclipse console window
  • You can type "q" then hit enter in the console window (or "r" for restart) (This may only work for Run Jetty Run)

If both of those fail, then if you're on linux or osx, you can open a terminal window and type the following to find the process id of Jetty and kill it. The process id is the 2nd column shown in the results, and you'll need to be careful that you're not seeing some other process here as well:

ps aux | grep jetty | grep java

then run the following to kill the process

kill process_id_from_above_call

You can run the above 2 commands in one shot by doing this:

kill $(ps aux | grep jetty | grep java | awk '{print $2}')

but be sure you're matching Jetty before you do this, as you may kill something you don't want to kill if it doesn't match correctly ;-) Note that if it still isn't killed by the above, you can force it to be killed by doing this:

kill -9 $(ps aux | grep jetty | grep java | awk '{print $2}')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top