title: How can I have multiple and separated classpaths in java?
body: <p>When I write code in nodejs, I can have multiple versions of the same library because 'require'-ing a library is not global. </p>
  
  <p>The classpath is different. Each library is looking at its <code>node_modules</code> library. </p>
  
  <p>However, in java, I cannot seem to be able to have multiple versions of same library in the classpath. </p>
  
  <p>As the classpath is global. </p>
  
  <p>Is there any way to make java behave more like node in that sense - by making each classloader have a different classpath?</p>
  
  <p><strong>why is my question different than <a href="https://stackoverflow.com/questions/6105124/java-classpath-classloading-multiple-versions-of-the-same-jar-project">that one</a></strong></p>
  
  <p>That question is based on "given a classpath, ... question .." while I am not assuming anything on the classpath. quite the contrary, I would like to have a different classpath for each library if possible. </p>