OK so I recently ran into a bit of jar hell when using a vendor supplied library that had dependencies on a library i already use for my application. Unfortunantly the version required by the vendor is an outdated version and my app requires some of the new features. After reading around it sounded like the best option was to create a custom class loader to load this library. I have the class loader working and all is good, i can instantiate my classes, execute methods on them using the java.lang.reflect api's and thats all fine and dandy but what i want to do is be able to call
I don't have the library in the classpath because this is loaded from the custom loaders classpath. Am I stuck calling everything by the method name? Am I smashing a grape with a sledgehammer?
David Newton wrote:Don't discount the use of a tool like jarjar when version conflicts like this happen.
Thanks, I never even knew this tool existed. Everything I found talked about writing custom class loaders for resolving dependency issues. This will be the path I am going to take. I prefer static typing over flexibility of reflect api's for something like this.