How to kill the process currently using a port on localhost in windows

<p>We everyone worked on Tomcat server and sometimes we are facing one common issue&nbsp;<strong><em>&ldquo;java.net.BindException: Address already in use: bind&rdquo;</em></strong></p> <p>How to resolve this? Steps to follow</p> <p><strong><em>Step 1</em></strong></p> <p>Run command-line as an Administrator. Then run the below mention command.</p> <blockquote> <p>netstat -ano | findstr : port number</p> </blockquote> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/1*l9ZwIwOFSImBGDNzoMwF8Q.jpeg" style="height:134px; width:700px" /></p> <p>Red colored circled area shows the PID (process identifier)</p> <p><strong><em>Step 2</em></strong></p> <p>Then you execute this command after identify the PID.</p> <blockquote> <p>taskkill /PID typeyourPIDhere /F</p> </blockquote> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:700/1*7h7BlAAJSlfjtpkOocwW6A.png" style="height:68px; width:700px" /></p> <p>Run the first command again to check if process is still available or not. You&rsquo;ll get empty line if process is successfully ended</p> <p><a href="https://medium.com/@javatechie/how-to-kill-the-process-currently-using-a-port-on-localhost-in-windows-31ccdea2a3ea"><strong>Click Here</strong></a></p>