How can I make a method call from a specific versioned jar when several versions are present

I have two versions of the same library, for example abc-1.0.jar and abc-2.0.jar, I can’t avoid using my application, parts of the code have not yet been ported to 2.0. How do I get the class object and methods to be from abc-2.0.jar? but not from 1.0.jar in my module.

any help was greatly appreciated!

Sashank Relations

+3
source share
2 answers

There is no general general but simple solution.

  • The easiest solution is to put 2 JAR files in the classpath and the 2.0 JAR file in front of the 1.0 JAR file. This will probably work for your use case, but it will not work if there are times when you need to use an older version of a class.

  • - JAR JAR 1.0 2.0. JAR .

  • - JAR 1.0 2.0. , , .

+1

, ( ), 2.0, , 2.0 1.0 .

( ) , 2.0, , 1.0, .

0

Source: https://habr.com/ru/post/1786926/