This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin 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: Calling JVM from cygwin


Fool, rushing in where angels fear . . . .

Ignasi Villagrasa wrote:

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


Umm, are you /really/ invoking *Cygwin* tools with Windows paths?  Or 
are you using the Mingw32 GCC that might be expected to understand 
"d:\jdk1.3.1\include"?

Also, last I heard, the Cygwin port of GCC didn't implement any support 
for the Java library - if that's relevant.

Or, maybe, I'm out of date :-).


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


-- 
David A. Cobb, Software Engineer, Public Access Advocate, All around 
nice guy.
New PGP key 09/13/2001:
:<http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=superbiskit&\
fingerprint=on>
:<http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=superbiskit&\
fingerprint=on>
Fingerprint=0x{E7C6_4EE2_6B75_5BA3_C52E__77FA_63C3_9366_DCFB_229B}
"By God's Grace I am a Christian man, by my actions a great sinner."
--The Way of a Pilgrim, R. M. French [tr.]
Potentially Viral Software is any software for which you are not allowed
to examine the source.  Do not buy or use Potentially Viral Software!


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


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