Windows端口被占用解决方法
发表于:2021-03-19 | 分类: 操作系统 Windows
字数统计: 162 | 阅读时长: 1分钟 | 阅读量:

Error 场景

启动 Java 项目失败,控制台显示

1
2
3
4
5
6
7
8
9
10
11
12
13
14

Error starting ApplicationContext. To display the conditions report`re-run your application with 'debug' enabled.

***************************
APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

解决方法

  • 查看那些进程占用了我们的端口号8080

    打开 Windows 控制台,输入命令

netstat -nao | findstr "8080"

可以看到占用 8080 端口的进程 PID 为 8404

  • 杀死相应进程:

    在 Windows 控制台,继续输入命令

taskkill /pid 8404 /f

avatar

上一篇:
BIO/NIO/AIO对比
下一篇:
AutoUpdater自动更新客户端