title: modify the classpath dynamically
body: <p>I want to add the configuration files under <code>/home/nameuser/.myProject/conf</code> to the classpath at runtime.</p>
  
  <p>I tried using <code>URLClassLoader</code> but without success.</p>
  
  <pre><code>URL[] url={new URL("file://foo")};
  URLClassLoader loader = new URLClassLoader(url);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ClassLoader currentThreadClassLoader
   = Thread.currentThread().getContextClassLoader();
  
  // Add the conf dir to the classpath
  // Chain the current thread classloader
  URLClassLoader urlClassLoader
   = new URLClassLoader(new URL[]{new File("mtFile").toURL()},
                        currentThreadClassLoader);
  
  // Replace the thread classloader - assumes
  // you have permissions to do so
  Thread.currentThread().setContextClassLoader(urlClassLoader);
  </code></pre>