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: 201
        
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