Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. – RobotHumans 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
up vote 2 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

Your Answer


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.