Get jar file name from Java process

Posted on 2011-02-24
Last Modified: 2012-05-11
When I am running any jar file, java.exe is shown in the task list of XP SP3
When I am running any java based website again , java.exe is shown in the task list of XP SP3

Now, I want to get which jar file is invoking that java.exe in the task list by C#. Is it possible? If possible, how?

Question by:Amitava_Mukherjee
LVL 47

Accepted Solution

for_yan earned 250 total points
ID: 34969084
The actual Java program which you are running from the point of view of the system (XP) is the
argument of command line command wwith which you start java virtual machine.
If you have a tool which could retrieve command lie argument(s) of the task - not just the name
of the program itself - this tool will print you the name of the initial class which Java VM uses to start
excution. As far as I know in task manager you just see only java.exe.
There may exist some tools whch also retrive command line arguments - those should help.
LVL 86

Expert Comment

ID: 34969997
LVL 92

Assisted Solution

objects earned 250 total points
ID: 34974208
> Now, I want to get which jar file is invoking that java.exe in the task list by C#. Is it possible? If possible, how?

Its not possible
for a start jar files do not invoke java.exe
java.exec May use one or more jars, but a jar file may also not be involved at all.
And just because a jar file is on the command line in no way implies that is actually being used.
Lastly many other jars that are not on the command line could also be being used by the process

Author Closing Comment

ID: 34977358

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question