java.lang.reflect.Proxy support with native code?

Martin Egholm Nielsen martin@egholm-nielsen.dk
Tue Jun 15 12:43:00 GMT 2004


Hi Andrew,

>  > >  > In my progress of porting my existing code to gcj, I've run into some 
>  > >  > problems with java.lang.reflect.Proxy.
>  > >  > When running the compiled code I get a java.lang.NoClassDefFoundError 
>  > >  > exception thrown for "$Proxy0"...
>  > >  > Is there an issue with java.lang.reflect.Proxy when running natively 
>  > >  > compiled code?
>  > > I've used it quite a lot with native code.  Let's have simple test
>  > > case, and we'll see what happens.
>  > I've attached a simple example, and below is the outcome of executing:
> I get 
=== SNIP ===
> with mainline on GNU/Linux on i686, so it looks like this may be a
> port specific bug.
May be so, I'm afraid...

> Try linking with -Wl,-whole-archive,-lgcj,-no-whole-archive.
That's actually solves the problem under both MinGW and Cygwin - great! 
Whatever they mean?

However, if I try that on target with "-static", I get an "Illegal 
Instruction" before anything else is even printed... There seems to be 
an error with my cross-compiler...

// Martin




More information about the Java mailing list