This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: null ClassLoader


>>>>> "Raif" == Raif S Naffah <raif@fl.net.au> writes:

Raif> for example i might write an application that loads a class with
Raif> the same name, but with different behaviour, from two different
Raif> jars, each with a distinct classloader.  i should then be able
Raif> to get two distinct instances of the same class.

Raif> if as it sounds to me, all classes are loaded by the same
Raif> classloader, and in the example above, the second class instance
Raif> (supposedly from the second jar) will not get loaded/created
Raif> which is contrary to the semantics of the classloader.

We're only talking about precompiled classes which are linked into the
application.  In this case you can't have multiple class loaders.  You
can still use multiple class loaders if you load classes at runtime.
This is true even for compiled classes, if you use Per's shared
library class loader (as opposed to the built-in one).

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]