How to get the path of a running jar file?

Posted by Morgaelyn on Stack Overflow See other posts from Stack Overflow or by Morgaelyn
Published on 2008-11-26T12:30:38Z Indexed on 2010/05/12 21:34 UTC
Read the original article Hit count: 130

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about executable-jar