This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


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

Re: Does jni work?


>>>>> "Martin" == Martin Kahlert <martin.kahlert@infineon.com> writes:

Martin> libsample.so: sampNat.c sample.h
Martin> 	gcc -shared -fPIC -o $@ $<

Here you build a library named `libsample.so'...

Martin>   static {
Martin>     System.loadLibrary("sampNat");
Martin>   }
Martin> }

... but here you try to load it with a different name

Martin> Exception in thread "main" java.lang.UnsatisfiedLinkError: sampNat: file not found

... which is what the exception tells you.

Martin> Did i make any mistake, or is this known not to work?

JNI ought to work.  The invocation API won't work.  And there might be
bugs; some testing has been done but it hasn't really been used for
real (as far as I know).

Tom

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