英文:
How to stop jetty if run by double clicking?
问题
我在Windows上安装了Jetty Java服务器。我进入了安装目录,并双击了start.jar文件。现在一个服务器在8080端口上不断监听。我需要停止这个服务器。
我在线上和文档中都查找了,最接近解决方案的是这个:
$ {jetty主目录}/ java -jar start.jar STOP.KEY=[密码] STOP.PORT=[端口] --stop
我尝试了很多次,但没有成功。也尝试过不带STOP.PORT
指令和不带STOP.PASS
指令,但都没有成功。显然,我需要使用启动服务器时使用的STOP.KEY
。但是,因为我双击了.jar文件来运行它,我对自己到底做了什么一无所知。我已经寻找了几个小时,希望找到一些默认密码或者可以杀死的服务,任何能让我释放8080端口的方法,但都没有找到解决方案。
有一个关于如何从Eclipse中停止它的问题,但对我没有起作用。
有人知道怎么在使用双击start.jar文件启动Jetty后如何停止它吗?
英文:
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?
答案1
得分: 0
这不是解决方案,但如果您需要以某种方式停止该进程,则可以使用以下解决方法:
在这个问题中由 @brad-wilson 发现 how-can-you-find-out-which-process-is-listening-on-a-port-on-windows
- 首先,找到在该端口上运行的进程:
PS: Get-Process -Id (Get-NetTCPConnection -LocalPort <PORT>).OwningProcess
- 然后像这样终止它:
PS: Stop-Process -Name <PROCESS_NAME>
这应该已经释放了该端口。
英文:
This is not the solution. But it´s a 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
- First, find the process running on the port:
PS: Get-Process -Id (Get-NetTCPConnection -LocalPort <PORT>).OwningProcess
- Then kill it like this:
PS: Stop-Process -Name <PROCESS_NAME>
This should have freed the port.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论