简体   繁体   中英

How to stop jetty if run by double clicking?

I installed the jetty java server on Windows. I went to the installation directory and double-clicked on the start.jar file. Now a server is constantly listening at port 8080. I need to stop this server.

I checked both online and the documentation and the closest I've come to the solution is this:

$ {jetty home}/ java -jar start.jar STOP.KEY=[PASSWORD] STOP.PORT=[PORT] --stop

I have tried this many times but it doesn't work. Also tried without the STOP.PORT directive and without the STOP.PASS directive with no success. Apparently, I need the STOP.KEY which was used to start the server. But, as I double-clicked the.jar file to run it, I have no idea of what I have actually done. I've been looking for several hours for some sort of default password, or a service to kill, anything that allows me to free the port 8080 but I haven't found any solutions.

There is a question about how to stop it from Eclipse but didn't work for me.

Does anyone know how to kill jetty if it started double-clicking the start.jar file?

This is not the solution. But it´sa workaround if you need to stop the process somehow:

Found in this question by @brad-wilson how-can-you-find-out-which-process-is-listening-on-a-port-on-windows

  1. First, find the process running on the port:
PS: Get-Process -Id (Get-NetTCPConnection -LocalPort <PORT>).OwningProcess
  1. Then kill it like this:
PS: Stop-Process -Name <PROCESS_NAME>

This should have freed the port.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM