Problem
I am trying to compile the native methods examples in the JDK "demo" directory. I've tried all four examples (native_c_demo native_c++_demo jni_c_demo jni_c++_demo); in each case I get the following errors when I run "mk":
"/usr/java/include/unixware/jni_md.h", line 29: error: invalid type combination + /usr/java/bin/java nfib sysAddDLSegment: dynamic linker : /usr/java/bin/../bin/i386/green_threads/java : error opening libfib.so (libfib.so) java.lang.UnsatisfiedLinkError: fib at nfib.main(nfib.java:9)
Cause
There are two possible causes:1. The UDK (Universal Development Kit) is not installed. (The UDK has not been released as of this writing, however some pre-release copies are available.)
2. The UDK is installed, but the mk file is pointing to the SCO OpenServer Development System compiler.
Solution
First, obtain a copy of the UDK when it becomes commercially available. This will install on OpenServer 5.0.4 and it will not replace the existing OpenServer 5.0.4 Development System. The UDK is required in order to use Java native methods.
Once the UDK is in place, copy the demo directories to a working directory such as /tmp. The demo directories (/usr/java/demo/*) are writable only by root, and several new files are created when native methods are used.
The file "mk" must now be edited to point to the UDK compiler rather than the OpenServer compiler. Using your favorite text editor, change the following line (number 13) from:
CC=${CC-/usr/ccs/bin/cc} # location of UDK C compilerTo:CC=${CC-/udk/usr/ccs/bin/cc} # location of UDK C compiler