I am new to Jetty and client/server architectures.
I managed to write a jetty server in eclipse and it works.
But how I can stop a jetty server? I heard something about stop.jar and start.jar. Where I can find it? Is it integrated in jetty-all-jar?
If jetty as maven plugin, you stop the server by pressing Ctrl+C and press Y to confirm terminate.
The various
jetty-all.jar
artifacts can be used for embedded jetty usage. If you decide to use this jar, you have to manage your own startup / shutdown.Update: 2015 : As of Jetty 9, the use of
jetty-all.jar
as a dependency is deprecated. This is because as of Jetty 9, it is now impossible to satisfy "all" of Jetty in a single aggregate jar. There are components of Jetty that cannot be included as they will cause problems with this aggregate jar. The future of Jetty, with HTTP/2 support, also makes this aggregate jar less useful as a dependency.Typical Embedded Mode usage
The thread that starts the server:
The other thread that tells the server to shutdown
At this point the original thread's wait on
server.join();
is complete and that thread continues to run.Standard Distribution Usage
If you use the standard distribution available from download.eclipse.org/jetty/ you have the
start.jar
that can be used to start/stop jetty itself.Once you have unpacked your jetty-distribution, you'll find a
start.jar
in the top most directory. This can be used as the following.The process that starts jetty:
The process that stops jetty: