GCJ's URLClassloader and 'core' protocol

Andrew Haley aph@redhat.com
Mon Jun 28 15:22:00 GMT 2004


Sal writes:
 > Andrew Haley wrote:
 > > Sal writes:
 > > > Andrew Haley wrote:
 > > > > Sal writes:
 > > > > > I've read the docs and looked into the code for URLClassloader and the 
 > > > > > 'core' protocol, but am still unable to figure out how to get it to work 
 > > > > > properly. Some help would be greatly appreciated.
 > > > > For loading classes you should used the "gcjlib" protocol.
 > > > 
 > > > I tried this protocol also... without any success. Does it work for 
 > > > statically linked classes? From what I could gather from the source 
 > > > code, it only will load resources from .so/shared objects.
 > > 
 > > You want to load statically compiled classes that are already linked
 > > into an executable, but into a different class loader context?
 > 
 > Yes, is this currently possible?
I doubt it. 
 > > > I'de like to keep all my classes linked into a self contained
 > > > executable if possible... though I think the ability to do both is
 > > > important.
 > > > 
 > > > > You should be able to load resources from shared libraries too.
 > > > 
 > > > Resources as in, images/.class files?
 > > 
 > > Class files are compiled when placed into a .so, other resources are
 > > just copied.
 > 
 > Can a compiled class be loaded from a .so from within a custom 
 > classloader context? It seems to work fine when the primordial/system 
 > classloader gets the request but from within a custom classloader I 
 > can't seem to get it to work.
This should work if you use the URLClassloader "gcjlib" protocol. If
it doesn't, please send a test case and we'll fix it.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /