Subject: Re: JNI interface
To: None <netbsd-java@netbsd.org>
From: Thomas Bieg <tomsbsd04@tiscali.de>
List: netbsd-java
Date: 07/29/2004 23:19:07
Hi David,

have you considered that sun-jdk runs under Linux emulation?
I would expect that you need to compile your native functions
into a Linux binary to get this working.

If this is not an option you could try to use a native JDK.
pkgsrc-wip has packages for native versions of Sun's JDKs, see
http://pkgsrc-wip.sourceforge.net/ (never tried them, though).

Tom


David Price wrote:
> Hello, 
> 	I would like to use JNI to call functions in a C library from java,
> when I try to do a get and set call such as:
> 
> 	field = (*env)->GetStaticFieldID(env,jvc,"float","F");
> 	(*env)->SetStaticFloatField(env,jvc,field,z);
> 
> java segfaults , with sigsegv 11.  Im doing the simple example case from 
> java.sun.com and it is also occuring in a java program called jemboss which I 
> am working on converting into a package to work under netbsd. 
> 
> My system setup is netbsd 1.6.1, sun-jdk/jre13-1.0.12, and my install of java 
> is mounted over NFS, with the -X option enabled in fstab.
> 
> Any feedback on whether JNI /does/doesnt/can be made to/ work would be greatly 
> appreciated.
> 
> Thanks, 
> David