Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find the running process by jar

 
Thirumurugan Sivaji
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to do coding for the following scenario,

Suppose when 4 jar files are executed then 4 java.exe will present in task manager. How could I find that which java.exe is executing which jar file.

If anybody have an idea or code please let me know.

Thanks in advance
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this post. It might be what you need...

http://www.coderanch.com/t/109334/Linux-UNIX/Get-UNIX-process-ID-java
 
Thirumurugan Sivaji
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your input but it is not the one I wanted. I can get the list of processes and process IDs through Runtime.exec("tasklist"); command. My question is if there are more than one processes with same name(for eg if you open 2 command prompt the task manager will display 2 cmd.exe) how do I identify which process(like cmd.exe) will points to which task(like command prompt).

Thanks in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic