Asked • 04/18/19

How to get the path of a running JAR file?

My code runs inside a JAR file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is.So, if foo.jar is in `C:\\FOO\\`, I want to get that path no matter what my current working directory is.

1 Expert Answer

By:

Abhijeet R. answered • 07/08/19

Tutor
New to Wyzant

Experienced Online Tutor in Core Java

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.