[kaffe] bootclassloader vs. SystemClassLoader problems

Dalibor Topic robilad at yahoo.com
Thu May 2 02:33:00 PDT 2002


Hi,

I've implemented a good deal of support for Packages.
The only problem I am experiencing with my code is:
kaffe seems to load most stuff with the boot class
loader, thus  I can't record any useful package
information in the SystemClassLoader.

Here is a small example program:

public class Test {
  public static void main(String [] args) {
    Class classLoadersClass =
Test.class.getClassLoader().getClass();
  }
}

This code works with the JDK, but fails on current CVS
version of kaffe with a null pointer exception,
indicating that Test.class is loaded with the boot
class loader.

I think that kaffe should use the SystemClassLoader
instead to load Test.class. The change should be quite
simple: a new class kaffe.lang.ExecClass is called to
run a Classes main method, just like kaffe.jar.ExecJar
is used for JARs.

kaffe.lang.ExecJar loads the class to run using the
SystemClasLoader, and runs its main method.

Any objections, ideas, questions?

dalibor topic


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com




More information about the kaffe mailing list