This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: null ClassLoader
- From: Tom Tromey <tromey at redhat dot com>
- To: "Raif S. Naffah" <raif at fl dot net dot au>
- Cc: Torsten Rüger <torsten dot rueger at firsthop dot com>, java at gcc dot gnu dot org
- Date: 21 Dec 2001 09:55:58 -0700
- Subject: Re: null ClassLoader
- References: <Pine.LNX.4.10.10111280033000.9325-100000@mars.deadcafe.org> <87zo4epw15.fsf@creche.redhat.com> <5.0.0.25.1.20011220192852.00a3beb0@mail.syd.fl.net.au>
- Reply-to: tromey at redhat dot com
>>>>> "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