启动项目失败,tomcat提示端口被占用

版权声明:本人原创文章,如需转载,还请注明出处。 https://blog.csdn.net/jin_tk/article/details/88553783

前言

经常我们在使用tomcat服务器启动项目时,会失败,并且提示你一大串的提示碧如“Several ports (8006, 8081, 8010) required by tommat Server at localhost(8081) are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).”大概意思就是端口被电脑中的某个程序占用,其实是你在关闭某个程序时,进程没有完全被杀掉。这种情况一般通过重启工具或者电脑都能解决。如果不想怎么办,我就想看看那个程序占用了,可以的,下面来看看一般的查询端口并杀掉如何来实现。

dos窗口查询

快捷键win+R,输入cmd,然后如下。

//根据端口号找到进程号
netstat -ano | findstr "8081"
//根据进程号找到占用的程序
tasklist | findstr "13780"

在这里插入图片描述

进程消除

通过上面查到占用程序后可以去任务管理器中直接结束进程,也可以直接用命令杀掉进程。

taskkill /f /t /im 程序名

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/jin_tk/article/details/88553783