Search code examples
javaclassloader

Two different version of jars on seperate threads in a single JVM


Is it possible to run two jars of different version, but runs on different thread on a single JVM. If so, please guide me in the right direction.


Solution

  • Sure, that is very well possible - when using multiple ClassLoader instances. Meaning: when each of your thread is using its own special ClassLoader, those threads could be working with "different" versions of the "same" jar file.

    But a word of warning: this is really an advanced topic that you don't want to get into lighthearted! If you are really interested in going there, you can find some further reading here.