Get jar file name from Java process

Posted on 2011-02-24
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 47

Accepted Solution

for_yan earned 1000 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month10 days, 18 hours left to enroll

770 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