• Post Reply Bookmark Topic Watch Topic
  • New Topic

choose different version at run-time  RSS feed

 
jammy chen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dao need to call some 3th Party jar, at firstly I import these class run successfully, But now they have pubished over 2 version, basically these version have the same package and class and both have a interface being support to me, so my problem is I want choose the different version at run-time ON every call. any have good Solutions. i don't want change some existing code.

maybe i have own classloader to load the jar is better, but I have using "import" the needed interface, how to change is impossible using own classloader. meanwhile, any call i need load the jar before run and unload all class which have load to jvm after finised?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any reason why you don't just use the most recent?
 
jammy chen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Any reason why you don't just use the most recent?


thanks your reply, what is your said the most recent?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean use the more recent version of this 3rd party jar file, or is there a specific reason you want your code to use the older version?
 
jammy chen
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:I mean use the more recent version of this 3rd party jar file, or is there a specific reason you want your code to use the older version?


YES, The recent version of this 3rd party jar is not only instead of older version, So we need choose different version depending input parameter ON VERY CALL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!