To start a Jetty Server, you can type the following command.
java -jar start.jar
The only way to stop the Jetty Server is by pressing Ctrl + C in the shell prompt.
Actually, there is a way to issue a stop command to the Jetty Server on another shell prompt. But you have to specify the STOP.PORT and STOP.KEY in the start command as follow.
java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar
After the Jetty Server is started, you can open another shell prompt and stop the Jetty by
java -DSTOP.PORT=8080 -DSTOP.KEY=stop_jetty -jar start.jar --stop
Done =)
Thanks for this!
LikeLike
you are welcome =)
LikeLike
Thaks for your help.
LikeLike
u are welcome =)
LikeLike
I get a response “ERROR: Not running!”, even though in obviously is. Any ideas?
LikeLike
i guess your jetty server has never been started. so when u issue a stop command, it tells you Not running!
LikeLike
is your jetty running normally after u started it? what is the jetty version?
LikeLike
Thanks
LikeLike
Thanks for your comment. =)
LikeLike
very handy! Just made a start script to run jetty on the background and was wondering how to stop it. Thanks!
LikeLike
Good to know that i could help. =D
LikeLike
Thank you very much 🙂
LikeLike
you are welcome~ =D
LikeLike
hi I have doubt like the DSTOP port number should be different than port number on which jetty server is running like we give same port number on which the jetty server is running in DSTOP argument . It throws error port number is already in use
LikeLike