title: Is it possible to "add" to classpath dynamically in java?
body: <pre><code>java -classpath ../classes;../jar;. parserTester
  </code></pre>
  
  <p>How can i get the functionality in the above command programmatically? Like, is it possible to run as:</p>
  
  <pre><code>java parserTester
  </code></pre>
  
  <p>and get the same result? I tried using URLClassLoader but it modifies the classpath and does not add to it.</p>
  
  <p>Thanx!</p>
  
  <hr>
  
  <p>Thanks for the response Milhous. But that is what i am trying to do.. How is it possible to get the jar into the classpath first? I tried using a custom classloader too :(</p>
  
  <p>That works.. But sorry that i need to run it only as:
  java parserTester
  I would like to know if such a thing is possible???</p>
  
  <p>It needs to be so bcoz i have parserTester.java and .class in a separate folder. I need to retain the file structure. The parserTester makes use of a jar in a separate jar folder.</p>