The same class, loaded by different classloaders, is a different class.
Thus, you can load different versions of the same library at the same time, by loading them with different classoaders. Even, the same version.
Now, there's necessarily the problem of which one of them a particular piece of code wants to use, which is determined by which classloader loaded that piece of code. You also can (and routinely do) have a path of nested classloaders that load different things.
Java was designed this way, right from the very beginning.
Thus, you can load different versions of the same library at the same time, by loading them with different classoaders. Even, the same version.
Now, there's necessarily the problem of which one of them a particular piece of code wants to use, which is determined by which classloader loaded that piece of code. You also can (and routinely do) have a path of nested classloaders that load different things.
Java was designed this way, right from the very beginning.
The problems with java are: