java to native code and Sun JVM alternatives
Andrew Haley
aph@redhat.com
Sun Mar 14 15:49:00 GMT 2010
On 03/14/2010 03:36 PM, wagde wrote:
> Thanx Andrew for the quick reply.
>> I'm trying to link my c code and I get:
> undefined reference to `JNI_CreateJavaVM'
> Although I have -lgcj in my ld command and it's the only undefined symbol in
> my code.
> Why is that?
You need to link with -ljvm.
> I still don't understand how JNI_CreateJavaVM will create a gij VM and not
> sun JAVA VM. can you explain this to me.
It's in gcj's libjvm.so, not Sun's. You have to make sure you link with
gcj's version of libjvm by putting it in the path at link time.
Andrew.
More information about the Java
mailing list