Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <96C14D00FA99D311A8D60008C791F36411628CA1@devwagwodx0009.wob.vw.de>
From: "Pasch, Thomas (ACTGRO)" <extern.thomas.pasch@volkswagen.de>
To: "'cygwin@cygwin.com'" <cygwin@cygwin.com>,
   "'gri@netcom.es'"
	 <gri@netcom.es>
Subject: Re: Calling JVM from cygwin
Date: Wed, 13 Feb 2002 17:17:12 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain

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/

