简体   繁体   English

如果通过双击运行如何停止码头?

[英]How to stop jetty if run by double clicking?

I installed the jetty java server on Windows.我在 Windows 上安装了码头 java 服务器。 I went to the installation directory and double-clicked on the start.jar file.我进入安装目录,双击start.jar文件。 Now a server is constantly listening at port 8080. I need to stop this server.现在有一个服务器一直在监听 8080 端口。我需要停止这个服务器。

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.还尝试了没有STOP.PORT指令和没有STOP.PASS指令但没有成功。 Apparently, I need the STOP.KEY which was used to start the server.显然,我需要用于启动服务器的STOP.KEY But, as I double-clicked the.jar file to run it, I have no idea of what I have actually done.但是,当我双击 .jar 文件运行它时,我不知道我实际做了什么。 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.我一直在寻找某种默认密码或要杀死的服务,任何可以让我释放端口 8080 的东西,但我没有找到任何解决方案。

There is a question about how to stop it from Eclipse but didn't work for me.有一个关于如何从 Eclipse 阻止它的问题,但对我没有用。

Does anyone know how to kill jetty if it started double-clicking the start.jar file?如果它开始双击 start.jar 文件,有谁知道如何杀死码头?

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@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.这应该释放了端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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