Check port occupancy and release ports in Windows (port 6258 fails to start in Java)

1. When starting the Java project, it prompts that port 6258 failed to start.

  • The error message is as follows:
    Insert image description here

2. Check port occupancy, release ports, and kill processes in Windows

  1. View all port information:neststat -ano
    Insert image description here

  2. Check the occupancy of a certain port:netstat -ano |findstr 6258 // 6258 is the occupancy of the Java port. Two Java projects are opened at the same time. In the following screenshots, the correct one should be ESTABLISHED Status
    Insert image description here

  3. Check the occupancy of port 6258: tasklist |findstr "6258"

  4. Release the Java process: taskkill /f /t /im "java.exe"
    Insert image description here

  5. After the process is successfully released, the Java project can be started as normal operations.

Guess you like

Origin blog.csdn.net/m0_50298323/article/details/131187589