0

Suppose I click on a java app's icon, and the app starts normally. How can I find out the path to the java executable that is running the app?

Better yet, is there a way to find the exact command-line invocation of java that would have the same effect as double-clicking on the icon? (Note: I'm aware of open -a, and it is definitely not what I'm asking about here. The command-line invocation I'm interested in should begin with java ..., specify a classpath, etc.)

2 Answers 2

1

Run your app, open a terminal, and try:

ps -awwx  -o command | grep java

ps, very wide, print the full command line, and look for java.

If you don't see the classpath, it may be passed in your environment variables, in that case, you may need to add the -E flag to ps. At this point, its messy, and you probably want to redirect to a file.

0

You could also run which -a java which will list all java executables found in your $PATH.

You must log in to answer this question.

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