Technical article 100869

I cannot compile native methods examples with JDK.

OpenServer 5.0.4

Written · Last revised

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 compiler
To:
CC=${CC-/udk/usr/ccs/bin/cc}    # location of UDK C compiler

From the Xinuos technical article database, record 100869. Reproduced with permission. The original is at www.sco.com/ta/100869, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.