1

If I execute

ps -ef | grep java

I get the following

noaccess 12144   908   0   Apr 28 ?         697:47 /usr/java/bin/java -server -Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4

Though, in this server we have many Java applications running. How do I identify which .jar was invoked by the ps output is showing?

3
  • You should re-evaluate the way you launch your applications. Eclipse and Aptana both report the launched jar properly. Mar 13, 2012 at 17:53
  • Parsing ps is always unreliable. You should have one process that runs them all, and keeps control over them. See Process Management.
    – geirha
    Mar 13, 2012 at 20:14
  • sometimes you don't have much control on how you start your third-party server (e.g. Hudson, Nexus). When one hang unexpectedly and has to be killed, how do you identify which one is which from the ps command?
    – Pomario
    Mar 14, 2012 at 13:07

1 Answer 1

2

You could try lsof. For example,

lsof -a -p 12144 -u noaccess | grep REG

which would list the regular files that process/user has open.

From the result you might be able to determine which java process is which.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .