关于tomcat端口被占用的解决方法

之前tomcat总是在重新启动项目的时候,提示如下错误

  Several ports (8080, 8009) required by Tomcat v6.0 Server at localhost 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)。端口被占用,但是我只是重新启动啊。后来发现规律,原来是每次eclipse卡死的时候,我都会强制关闭eclipse,导致tomcat并没有关闭,所以在重新发布项目的时候,就会出现端口被占用的错误。以前都会傻逼的重新启动计算机。

解决方法;

1,cmd 命令窗口,找到被占用端口的进程。netstat   -ano|findstr  8080  ,  netstat   -ano 。

2,杀死该进程。taskkill  /pid  6856  /f    
6586为pid.

原文地址:https://www.cnblogs.com/li-zhan/p/6682434.html