Recently write the project, always appear port is occupied problem, originally silly computer restart, finally one day can't stand, want to find a way to solve. Just started from the Internet to find a lot of tutorials, found no. Start your own attempt, and finally, successfully kill the process that occupies the port. The process is documented here (take port 8080 as an example):
The first step is to open the cmd Command window, enter the command, and find the corresponding process number according to the port number .
-ano | findstr 80 //列出进程极其占用的端口,且包含 80
The results are as follows:
8080 ports were found to be occupied by PID (process number) 9268 process.
The second step, according to the process number to find the process name
| findstr 9268
Find the program from the Task manager based on the process number and kill it manually.
But I found that the program was not found in Task Manager. Had to obey the line to kill the program, the command is as follows:
-PID <进程号> -F //强制关闭某个进程
This will take up 8080 port process to kill, and finally can happily not restart the computer.
Transferred from: http://blog.csdn.net/violet_echo_0908/article/details/50129679
A process that kills a port in Windows