JNI Problem

Prashant Patel pmpatel at trinetcommunication.com
Thu Sep 14 07:52:11 PDT 2000

Hello Everyone
       I have successfully ported Kaffe on motoroal power pc with linux . I
am using java native interface to talk to serial port. I have used the
kaffeh to create the "Hello.h" file from "Hello.class" and writen the
implementation of "Hello.h" file into "Hello.c" file.   Now i have created
the shared library file using following commands.
   gcc -c -fPIC Hello.c -o Hello.o
   ld -shared -o libHello.so Hello.o
   According to my knowledge about linux, whenever JVM  call
"System.loadLibray("Hello")" function, it will search for the library (which
we created "libHello.so")  in the "/usr/lib" or "/lib" directory.  I copied
the library file "libHello.so" to the "/usr/lib" and "/lib" directory. But
whenever i run the  my Hello.class program using kaffe, i am getting
following error.
java.lang.UnsatisfiedLinkError: file not found
        at java.lang.Throwable.fillInStackTrace(Throwable.java:native)
        at java.lang.Throwable.<init>(Throwable.java:38)
        at java.lang.Error.<init>(Error.java:21)
        at java.lang.LinkageError.<init>(LinkageError.java:21)
        at java.lang.Runtime.loadLibrary(Runtime.java:141)
        at java.lang.System.loadLibrary(System.java:144)
        at test.main(Hello.java:6)
       I tested my program with the Sun JDK on Intel platform with linux And
it is working fine over there. But i don't know why the same program doesn't
work with kaffe JVM on power pc platform with linux. So can anybody give me
any suggestion ?

Prashant Patel

More information about the kaffe mailing list