cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: jar files in classpath
Date Mon, 20 Mar 2000 14:51:14 GMT
JJD wrote:
> 
> Hi: This is interesting, because I always had a hard time understanding the
> issue of classpath. Can you elaborate why/how $JAVA_HOME/jre/lib/ext works?
> Thanks in advance for any info. JJD

"ext" was added to Java 1.2 to allow easy installation of standard
platform extentions. These are usually jar files (+ eventual native
libraries) that are required  in case you need standard extentions.

Examples of those extentions are:
 - java3d
 - servlets
 - jndi
 - jti
 - jmi
 - jai
 - and so on..

the $JAVA_HOME/jre/lib/ext is usually referred to as the
"bootclasspath". In java 1.2 "java" executable there is a now
"-bootclasspath" flag that can change the location of such
bootclasspath. So, for example, if you consider "xerces.jar" and
"xalan.jar" extentions to your environment, you could run cocoon from
the command line as

 java -bootclasspath ./lib org.apache.cocoon.Cocoon

instead of copying them inside the $JAVA_HOME/jre/lib/ext directory,
thus influencing every other program (that may get in conflicts with
your added libraries).

So, as a general rule, libraries are not extentions. Extentions are
those things that are required by all and change their interfaces very
rarely. So, for example, while DOM, SAX, JAXP and TRaX are extentions,
xalan and xerces are not (they implement those interfaces).

Also, the bootclasspath is always loaded _before_ your classpath and the
standard java classloader loads a class with the required name as the
_first_ occurrence of that class. So if you have a DOM1 interface in
your extentions and want to use DOM2 included in your classpath, you
simply can't!

So, site-wise, it's a good practice to place interfaces and APIs inside
the extentions directory and never place interface implementations, or,
even worse, java applications.

Please note that Sun fully understands how difficult it is to install a
java application in a system. For this reason, it was created a proposal
for the creation of a standard way to install and deploy both
extentions, libraries and applications. This is currently discussed
inside the JCP, but I know nothing else about (read the JCP site for
more info on this).

Hope this helps.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message