I have some tips from experience with both Win32 and AIX platforms. I'm
assuming that HP UK C dynamic link libraries are built similar to AIX
ones...?
- JDK 1.18 uses JNI version 1.0 bindings by default. Use the -jni option
with javah to create a JNI 1.1 style C headers. These are easier to link
with.
- Make sure you use the generated header for the basis of the function
implementation (rather than copying by hand). This will ensure you get the
function header exactly right.
- The unsatified link exception can occur for many reasons: the library is
not found (not on the LIBPATH for instance), the method wasn't resolved (not
exported or wrong signature in C)
Given the following java class with natic methods:
package a.b;
public class c {
public native void doSomething() {}
public native void doSomethingElse() {}
}
You will need an export file with your so/shared library/DLL containing the
mangled function prototypes, For example, in foo.exp ( the export file for
the library foo.so ) I have: -
Java_a_b_c_doSomething
Java_a_b_c_doSomethingElse
This is the JNI 1.1 C export for the above java code.