title: Simulate app.config for Java?
body: <p>I know that you can use java.util.Properties to read Java properties files.</p>
  
  <p>See: <a href="https://stackoverflow.com/questions/212539/java-equivalent-to-app-config">Java equivalent to app.config?</a></p>
  
  <p>Is there a standard place to put this file? In .NET we put application.exe.config in the same directory as application.exe. The application looks for it here by default.</p>
  
  <p>Java can be made to look for a properties file in the class path but I am struggling to understand the filename/path structure to use and how to use either a standard .properties format or XML format file.</p>
  
  <p>Assuming I have an API packaged in org_example_api.jar (the root package is org.example.api). I don't want to put the properties file inside the jar as it should be editable by the user. I want the user to be able to put the required configuration properties in either a .properties or .xml file somewhere relative to the classpath so I can find it without needing to know anything about the ir file system structure.</p>
  
  <p>Will this work on all systems:</p>
  
  <pre><code>/classpath/org_example_api.jar
  /classpath/org/example/api/config.properties OR
  /classpath/org/example/api/config.xml
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>java.util.Properties = ? //NEED SOME HELP HERE
  </code></pre>