启动springboot项目,报端口被占用

时间:2024-03-15 11:40:39

idea报错:

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

 

出现这个问题主要是因为端口被占用,解决步骤:

1、首先快捷键 win+r 调出命令行;

2、在命令行输入:netstat -ano|findstr 8000,就可以找到该端口所占用的线程的pid

(netstat -ano|findstr+空格+端口号,这里需注意netstat后面有个空格)

打开任务管理器,可以看到pid对应的进程,确定占用端口的进程。

启动springboot项目,报端口被占用

3、 找到端口所占用的线程的pid,就可以通过pid杀死进程杀死进程,在命令行输入:taskkill /f /pid 14656,就可以杀死进程。(taskkill /f /pid 14656,14656是你的pid)

 

 

上面几个简单的步骤就可以关闭某个端口所占用的线程。