title: JAR versions dependency conflict - Java
body: <p>Say you have a project (web app) which uses 2 third-party libraries - A and B.<br>
  Say A depends on version 1.10 of another third-party library C.<br>
  Say B depends on version 1.15 of the same third-party library C.   </p>
  
  <p>Which version of C should you put in the lib folder of your web app project?! </p>
  
  <p>Assume you don't know C well, you're not sure if C 1.15 is compatible with 1.10, or anything like that. </p>
  
  <p>Is there a way to put A.jar and B.jar, and both C jars in the lib folder of your project, but at runtime (under Tomcat or JBoss e.g.) have A load C 1.10 jar, but have B load C 1.15 jar.   </p>
  
  <p>I don't think this is possible as they share the same web app class loader (and so it will load the C classes either from 1.10 or from 1.15 pretty much unpredictably; whichever of the two JARs happens to be first on the classpath) ... but I'm not sure.  </p>
  
  <p>If it's indeed not possible, what's the best practice for handling this kind of conflicts?  </p>