Quantcast
Channel: Java - how to load different versions of the same class? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Atul Soman for Java - how to load different versions of the same...

For a sample implementation of the accepted answer by @helios checkout github.com/atulsm/ElasticsearchClassLoader

View Article



Answer by helios for Java - how to load different versions of the same class?

You're going the right way. You must take some things into account. The normal thing is classes that exist in parent classloaders are used. So if you want two versions those classes must not be there....

View Article

Answer by Andrey Borisov for Java - how to load different versions of the...

it depends on what are u going to do with both versions and how, but in general you can at least load 2 version of class in different classloaders, and then set the Thread.contextClassloader() and...

View Article

Answer by AlexR for Java - how to load different versions of the same class?

You have almost written the solution. I hope the following code fragment will help. ClassLoader cl = new URLClassLoader(new URL[] {new File("v1.jar").toURL()},...

View Article

Java - how to load different versions of the same class?

I have read a lot about Java classloaders, but so far I have failed to find an answer for this simple question: I have two versions of com.abc.Hello.class in jars v1.jar and v2.jar. I want to use both...

View Article

Browsing all 5 articles
Browse latest View live




Latest Images