When Java starts the project, the console reports that the port is occupied. Solution

Port occupation usually means that another program is using the port.

The first step is to find out which program is occupying it:

netstat -aon | find "8113"    //8113为被占用的端口号

The result at this time is as follows, the query is the PID of the program occupying this port (25472)

 Then find out the program occupying the port based on 25472:

tasklist|findstr  "25472"      //25472为我本地占用端口程序的PID

At this time, you will find out what program occupies this port. If the program is of no use, just close it.        

 

At this time, I think the program was not shut down completely when restarting, causing the port to still be occupied. I can just close the port.

Close the port and execute the following code:

taskkill -f -pid 25472

The complete effect is:

 

Guess you like

Origin blog.csdn.net/tck001221/article/details/131400305