When starting tomcat, the console reported an error and found that the port was occupied, so I looked for a way to close the corresponding program.
I searched online for a long time, and after trying it, I found that it doesn't work. Start to try it yourself, and finally, successfully kill the process that occupies the port. Record the process here (take port 8081 as an example):
The first step is to find the corresponding process number according to the port number
netstat -ano | findstr 80 //列出进程极其占用的端口,且包含 80
The result is as follows: It is
found that port 8081 is occupied by a process with a PID (process number) of 2000.
The second step is to find the process name according to the process number
tasklist | findstr 2000
Find the program in the task manager and kill it manually.
So far, it has been completed.
But I found that the program is not found in the task manager. Had to kill the program from the command line, the command is as follows:
taskkill -PID <进程号> -F //强制关闭某个进程
That's it.