This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project.


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

Re: Changing classpath whilst Kawa runs


"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


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