[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: STOP INCLUDING EXTERNAL JARS IN YOUR JAVA PACKAGES!



On Fri, Nov 09, 2001 at 02:05:17PM -0600, Adam Heath wrote:
> On 9 Nov 2001, Kevin A. Burton wrote:
> 
> > And what if foo requires libbar-1.1.3 which is incompatible with the fictional
> > libbar-1.1.0 that jboss requires?
> >
> > How do you install both on the same system...  Do you compute the CLASSPATH in a
> > different manner for each application?
> 
> You treat it just like any other applicaction, when the libraries it uses are
> changed.  You fix the application.
> 
> Additionally, if libbar-1.1.3 breaks apps that that use libbar-1.1.0, then
> libbar-1.1.3 is broken.  Please read the docs sun has on the subject(they are
> very concerned about never breaking backwards compatibility).


How about when libbar-2.0 comes along, and justifiably breaks
backwards-compatibility? Must we not use all apps relying on libbar-1.x,
until they upgrade?

Most Java apps run as the only thing in the JVM. I don't see what's
wrong with one app using libbar-1.x in one JVM, and another using
libbar-2.x in another.

Also, Java has hierarchical classloaders, which allow multiple
incompatible versions of classes to be loaded into the same JVM. Take
Tomcat 3.3 and 4.0 for example. Tomcat uses JAXP 1.1 and Crimson, but
webapps are free to use any incompatible jars they like (a hypothetical
JAXP 2.0, for instance). So assuming a perfect world where everything is
in a .deb, Tomcat requires libjaxp-1.1, my webapp requires libjaxp-2.0,
and there's no conflict.

We're not in Kansas anymore, Toto :) The old rules don't always apply.


--Jeff



Reply to: