This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Classpath vs java.class.path
- From: Mark Wielaard <mark at klomp dot org>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Steve Pribyl <steve at netfuel dot com>, tromey at redhat dot com, gcj mail list <java at gcc dot gnu dot org>
- Date: 17 Jul 2003 00:30:23 +0200
- Subject: Re: Classpath vs java.class.path
- References: <Pine.LNX.4.44.0307161602130.11090-100000@ops2.one-point.com>
Hi,
On Wed, 2003-07-16 at 22:05, Jeff Sturm wrote:
> On Wed, 16 Jul 2003, Steve Pribyl wrote:
> >
> > System.setProperty("java.class.path","/var/netfuel/lib/mysql-connector-java-3.0.8-stable-bin.jar");
>
> When you reach the main() method of your program, VMClassLoader has
> already been initialized and it is probably too late to redefine
> java.class.path.
In GNU Classpath we have a application/system classloader which would
make setting that system property during runtime work
(gnu/java/lang/SystemClassLoader.java). It even tries to do intelligent
caching of the paths described by the system property.
You could integrate that with libgcj and let VMClassLoader only handle
the bootstrap classpath and then have the SystemClassLoader (with
VMClassLoader as parent) handle the user classpath (and the system
property). It is somewhere on my big list of things todo when I have
time...
Cheers,
Mark