前言
经常我们在使用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 程序名

本文介绍了解决Tomcat服务器启动时遇到的端口冲突问题,提供了查询占用端口的程序及释放端口的方法,包括使用dos命令进行进程查询和杀死。
1万+

被折叠的 条评论
为什么被折叠?



