Dynamic class loading

Godmar Back gback@cs.utah.edu
Sat Apr 1 00:00:00 GMT 2000


> 
> Tom Tromey <tromey@cygnus.com> writes:
> 
> > First we try to load a .so.  Then we try to find the .class file for
> > the interpreter.  This choice was fairly arbitrary.
> > 
> 

It seems that .so files should be treated more similar to .jar or .zip
entries in a CLASSPATH than to a .class file.  In fact, one simple
solution would just be to allow .so files alongside .zip, .jar, or
directory paths in a CLASSPATH var (or GCJ_CLASSPATH, as the case may be.)
There shouldn't have to be any relationship between the name of
the class being loaded and the name of the .so file, me thinks.

Of course, there are important differences that must be accounted for
somehow:  for instance, if you define class A from x.so, you'll have to 
define all classes that are contained in x.so from there or else your
dynamic linker will complain.
(Unlike in a .jar archive, which you can treat as a directory of files
that are not related by much more than their being part of a group.)

	- Godmar



More information about the Java mailing list