Find the PID of a process that uses a port on Windows

前端 未结 7 1215
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 16:58

My service crash on startup with the classic:

java.rmi.server.ExportException: Listen failed on port: 9999

How can I find the process for k

7条回答
  •  半阙折子戏
    2020-11-30 17:22

    Find the PID of a process that uses a port on Windows (e.g. port: "9999")

    netstat -aon | find "9999"
    

    -a Displays all connections and listening ports.

    -o Displays the owning process ID associated with each connection.

    -n Displays addresses and port numbers in numerical form.

    Output:

    TCP    0.0.0.0:9999       0.0.0.0:0       LISTENING       15776
    

    Then kill the process by PID

    taskkill /F /PID 15776
    

    /F - Specifies to forcefully terminate the process(es).

    Note: You may need an extra permission (run from administrator) to kill some certain processes

提交回复
热议问题