Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
You should re-evaluate the way you launch your applications. Eclipse and Aptana both report the launched jar properly. –  hbdgaf Mar 13 '12 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 '12 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 '12 at 13:07
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.