title: How to get the path of a running JAR file?
body: <p>My code runs inside a JAR file, say <strong>foo.jar</strong>, and I need to know, in the code, in which folder the running <strong>foo.jar</strong> is.</p>
  
  <p>So, if <strong>foo.jar</strong> is in <code>C:\FOO\</code>, I want to get that path no matter what my current working directory is.</p>