Detecting Java Processes listening on local ports

We can use the jps command that is part of JDK to find out which Java processes are running in the current user’s session. We can further find out which network ports have been opened by a particular java process.

Use the follwing command to list all java processes:
jps -l

If you want more details about a process you can execute the following command:
jps -v | findstr <process id>

The following variant of netstat command lists all the listening as well as established socket connection in a system:
netstat -ano

This command can be further used to find out what sockets are opened by a specific process
netstat -ano | findstr <process id>

Leave a Reply

Your email address will not be published. Required fields are marked *