title: Can I use the classpath to override a file in a jar that is being run?
body: <p>I have a JAR file that contains an application as well as configuration files for that application. The application loads configuration files from the classpath (using <code>ClassLoader.getResource()</code>), and has its dependencies completely satisfied using the configuration files baked into the JAR file.</p>
  
  <p>On occasion I want the application to be run with a slightly different configuration (specifically I want to override the JDBC URL to point to a different database) so I create a new configuration file, store it in the correct directory structure (which means in a directory <code>/config</code> of a classpath entry), and I want to do something like this:</p>
  
  <pre><code>java -cp new-config:. -jar application.jar
  </code></pre>
  
  <p>But I can't get the classpath to have the <code>new-config</code> path entry before the application JAR's contents. Is it hard-coded that the JAR's content is always the first thing on the classpath?</p>