How to get a running Jar's file path?

0

When I run some jar file, the process created is an instance of the JVM, which executes the jar. How can I know what jar file a JVM process is running? I would like to use this information to retrieve said jar's file path.

Bruno Fauth

Posted 2018-02-25T19:45:48.120

Reputation: 13

How to get the path of a running JAR file? – DavidPostill – 2018-02-25T19:54:52.393

That post only works if you have the source code for the Jar. My case is more general. I want to find the path for any jar running on my machine, even if I don't have the source code. – Bruno Fauth – 2018-02-25T20:27:20.753

Answers

0

Invoke the JAR by using the full path as the -jar parameter from the command line. The Task Manager can show the command line which includes the path to the JAR. Open it by running taskmgr from Windows search. Then do one of the following:

  1. In the Processes tab, right-click the column header and enable the Command Line option.

OR

  1. In the Details tab, right-click the column header, click Select Columns, click the Command Line checkbox, and click OK.

References

Paul Sweatte

Posted 2018-02-25T19:45:48.120

Reputation: 613