• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Library Jar Compatibility

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I compile a set of java class files with some library jar and while running it, I specify new library jar i.e. newer version of the library jar, will that affect? I think yes but not always. Comments?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The classes in the new jar will be used at runtime, of course. Whether this will work or not depends on whether the public APIs of the classes have changed. As long as the new jar includes the classes your code uses, and those classes still have the methods you called, then things will link just fine. Now, if the behavior of those methods has changed, then you might still have some problems.
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response. I have the similer thoughts. What about the reverse case? I mean to say, compiled with the old lib jar and running with the new lib jar? I think same problem may occur in terms of if the behaviour of a method is changed. I don't know why but I feel that at both the times, one should always have the same versions of the lib jar.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bimal Patel:
I don't know why but I feel that at both the times, one should always have the same versions of the lib jar.



No, not really. If this was true, we wouldn't use jars at all -- you'd package everything into one indivisible blob to avoid this kind of problem. But being able to upgrade a libary without recompiling an application is a nice, useful, and valid thing to do.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic