4

Windows解除端口占用, 强制关闭/杀死某端口进程

 3 years ago
source link: https://www.bugcatt.com/archives/2426
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

阿航在使用IDEA开发Spring boot项目时, IDEA突然崩溃并闪退. 再次进入时, 提示我端口被占用. 稍微思考了一下, 问题的原因应该是IDE虽然被关闭了, 但是Java进程还在. 所以本篇文章就来记录下Windows如何解除端口占用, 强制关闭/杀死某端口进程.

按下快捷键Windows+R, 打开运行窗口, 输入CMD, 点击回车:

找到端口对应ID

打开终端, 输入以下命令(把端口号替换成你的):

netstat -ano | findstr :端口号
可以看到, 如果你有占用的端口, 将会返回一个表格.

我们的重点就在最后一列, 记住它. 我们即将通过这个ID来杀死该进程.

Windows解除端口占用-03

通过ID杀死进程

接下来我们就要来强制停止, 也就是杀死进程了.

输入以下命令(把进程ID替换为你上面查到的):

taskkill /f /im 进程ID

如果成功, 会返回类似成功: 已终止 PID 为 .... 的进程的信息


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK