Subject: Calling JVM from cygwin
From: Ignasi Villagrasa <[email-masked]>
To: [email-masked]
Date: Mon, 12 Nov 2001 13:11:55 +0000

I'd like to call JVM from C native call using Cygnus compiler.

I work in W2000 enviroment using GCC Cygnus compiler.

I followed JNI instructions.

I read in Java forums there was a change in JDK, and instead of  
attaching javai.dll, jvm.dll had to be attached.

Then I made a test using invoke.c example from JDK.

I built following .bat file:
gcc -c invoke.c -Id:\jdk1.3.1\include -Id:\jdk1.3.1\include\win32
DLLTOOL --dllname jvm.dll --def libjvm.def --output-lib 
d:\jdk1.3.1\jre\bin\classic\libjvm.a
c++ -o invoke.exe invoke.o -Ld:\jdk1.3.1\jre\bin\classic -ljvm

with libjvm.def :

EXPORTS
_imp__JNI_GetDefaultJavaVMInitArgs@4
_imp__JNI_CreateJavaVM@12

All seems to work fine, and invoke.exe is generated. But when trying to 
run it, I get a windows message telling me :

invoke.exe doesn't find the entry point to _imp__JNI_CreateJavaVM@12 in 
jvm.dll.

What am I going wrong ?

Any calling convention issue ?

I have seen several messages about JNI linking, and tried some changes 
in .def calls with no results.

Is there anyone having the same problem ?

Thanks in advance. Ignasi Villagrasa.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/