Dynamic class loading

Per Bothner bothner@cygnus.com
Sat May 1 12:45:00 GMT 1999


> I mean compiling java into object (.o) files as opposed to .class files.
> Then link it to a jni compatible library file (.so or .dll)

Yes, we intend to support that.  We'd need an option or a wrapper
to indicate that the native methods are jni instead of cni.  The
details have not been nailed down, as our assumption is that other
features are higher priority than jni support.

> I didn't realize that gcj has its own jni.h. I was referring to to one that
> comes with the jdk.

We have the beginnings of a jni.h.  We do have to provide our own.
But note our jni.h has to be binary compatible with the jdk one
(that is the whole point of jni).

> from this create the class equivalent of:
> public class Simple {
>     native Simple getInstance();
>     native void hello():
> }

I utterly fail to see the point.

> I realize this is outside the purpose of gcj.

Yes - it is cmpletely unrelated to what we're trying to do.

>  Its not something I expect it to
> do. I just think its an interesting idea that would be useful.

Why?

> If nothing else it would allow developers (or managers) to ease into
> gcj without having to compile the entire program into an executable.

There are better way to do that.  For example add an interpreter and
support for ClassLoader to libgcj.

	--Per Bothner
bothner@cygnus.com     http://www.cygnus.com/~bothner





More information about the Java mailing list