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:
2. Check port occupancy, release ports, and kill processes in Windows
-
View all port information:
neststat -ano
-
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
-
Check the occupancy of port 6258:
tasklist |findstr "6258"
-
Release the Java process:
taskkill /f /t /im "java.exe"
-
After the process is successfully released, the Java project can be started as normal operations.