This is the mail archive of the
kawa@sourceware.cygnus.com
mailing list for the Kawa project.
Re: Changing classpath whilst Kawa runs
- To: "Nic Ferrier" <nferrier at tapsellferrier dot co dot uk>
- Subject: Re: Changing classpath whilst Kawa runs
- From: Luke Gorrie <luke at bluetail dot com>
- Date: 29 Feb 2000 14:23:20 +0100
- Cc: kawa at sourceware dot cygnus dot com
- References: <s8bbbce0.094@tapsellferrier.co.uk>
"Nic Ferrier" <nferrier@tapsellferrier.co.uk> writes:
> I use Kawa for scripting mostly and so thought that a Kawa func to
> add dirs dynamically to the classpath would be usefull (maybe even
> using completion!) - so I wrote a func around this:
>
>
> (invoke-static <java.lang.System> 'setProperty "java.class.path"
> classpath)
>
> This works... at least it seems to.
>
> The property gets updated as you would expect but Kawa can't find any
> code in any added classpath directories or jar files.
I believe that this property is provided FYI, and (as with other
properties such as user.dir) doesn't have the direct effect you might
expect. You'll want to have a separate ClassLoader that's under your
control to handle this, eg. a subclass of java.net.URLClassLoader with
an 'addURL' method or something like that.
I don't know Kawa's guts so I can't suggest how to do it. I expect
though that Kawa does a fair bit of classloader'ery so there's
probably somewhere you can slip this feature in already.
Cheers,
Luke