public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Calling JVM from cygwin
@ 2002-02-13  8:17 Pasch, Thomas (ACTGRO)
  0 siblings, 0 replies; 5+ messages in thread
From: Pasch, Thomas (ACTGRO) @ 2002-02-13  8:17 UTC (permalink / raw)
  To: 'cygwin@cygwin.com', 'gri@netcom.es'

Some time ago, Ignasi Villagrasa wrote:

> [...]
> 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. 
> [...]

Hello, 

you are right, there seems to be problem in invoking java from cygwin
(the other way round works all right). It seem that mingw is doing a 
better job here. 

Perhaps http://www-106.ibm.com/developerworks/java/library/j-jnidebug/
is interesting for all. Code examples are included here as well. I can't 
get invocation.zip to work under cygwin. It compiles all right, but
invoking main.exe will lead to a Segmentation fault.

Anyway, your *def file is wrong. Should be something like:

EXPORTS
JNI_CreateJavaVM
JNI_GetCreatedJavaVMs
JNI_GetDefaultJavaVMInitArgs

Kind regards,

Thomas


--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Calling JVM from cygwin
@ 2001-11-01  9:53 Ignasi Villagrasa
  2001-11-02  8:39 ` David A. Cobb
  2001-11-11  8:26 ` Ignasi Villagrasa
  0 siblings, 2 replies; 5+ messages in thread
From: Ignasi Villagrasa @ 2001-11-01  9:53 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-13 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-13  8:17 Calling JVM from cygwin Pasch, Thomas (ACTGRO)
  -- strict thread matches above, loose matches on Subject: below --
2001-11-01  9:53 Ignasi Villagrasa
2001-11-02  8:39 ` David A. Cobb
2001-11-11  8:26   ` David A. Cobb
2001-11-11  8:26 ` Ignasi Villagrasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).