This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: Problems using a compiled jar with gcj


On Tuesday, August 10, 2010, Andrew Haley wrote:
> You are trying to redefine one of gcj's core classes,
> sun.reflect.Reflection.  This is never going to work, no matter what
> combination of options you try to use: the compiled binary interface
> requires core classes to be unique.
> 
> So, I removed the classes that already exist in libgcj, and it gets
> much further.

oops. don't remember where I got that jar file, but the ReflectionHack was to 
avoid errors like:

undefined reference to `hidden alias for java::lang::Class* 
sun::reflect::Reflection::getCallerClass(int)'

from the classes in the jar file.


I downloaded the reference implementation of JSR 223 and I extract the javax 
part (as I get other "undefined reference to `hidden alias" errors if I use 
the extracted script.jar from the reference implementation of JSR 223 as you 
can see when you run my script).

Now the SIGSEGV is gone. Thanks!


> You have to call JvAttachCurrentThread.

oops I missed that when I created the test case from my real application.

> -findirect-dispatch -fno-indirect-classes is correct.

That's what I reasoned after a vast research on the net.

However now I do get a "java.lang.NoClassDefFoundError: 
javax.script.ScriptEngineManager" Error.

I would expect a NoClassDefFoundError for the jython script engine itself, as 
I did not provide it on the classpath, but ScriptEngineManager is in the 
shared library compiled from the jar, so why do I get a NoClassDefFoundError?


To run my new script you need to get the reference implementation of JSR 223.
Please download sjp-1_0-ea-linux-i586.tar.gz from 
http://jcp.org/aboutJava/communityprocess/pr/jsr223/index.html

Thanks!

> Andrew.

Lothar

Attachment: gcjtest.tar.bz2
Description: application/bzip-compressed-tar

Attachment: log.txt
Description: Text document


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