title: Accessing executing folder when running a jar file
body: <p>I would like to be able to run a jar file <code>java -jar myapp.jar</code> on different folders and have it load <code>config.properties</code> based on the executing context.</p>
  
  <pre><code>/myapp/myapp.jar
  
  /folder1/config.properties
  /folder2/java -jar /myapp/myapp.jar    &lt;------ loads /folder1/config.properties
  
  /some/folder2/config.properties
  /some/folder2/java -jar /myapp/myapp.jar   &lt;------ loads /folder2/config.properties
  </code></pre>
  
  <p>Once the properties are loaded, I want it to then create some files in the current execution folder.</p>
  
  <p>So:</p>
  
  <ol>
  <li>How do I tell java to load a properties file based on the current executing context?</li>
  <li>How do I get access the folder that the jar was executing from?</li>
  </ol>