This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCJ's URLClassloader and 'core' protocol


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.


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