Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - get PID of external process by command line in Windows 7

I have Windows 7 32 bit with Java:

How do I get the PID of a process by command line in Windows 7?

I want to kill an application which I only can truly identify by the command line which ran it. We have several Java applications running on that machine. I need to stop specific ones.

To be exact: I need to find tomcat which is run by catalina.bat. What do you think is the best way to do this?

I know of tasklist, but it does not seem to be able to query the command line which started the process. Finding java.exe does not help me. I tried searching for something useful like pgrep/pkill for Windows, with no success.

like image 652
annih Avatar asked Dec 06 '22 13:12

annih


1 Answers

You could use jps -lv command to determine java process by it's command line options. jps is utility that included in many up-to-date JDKs.

like image 154
Konstantin V. Salikhov Avatar answered Dec 09 '22 03:12

Konstantin V. Salikhov