NonStop Server for Java 4.2 Programmer's Reference
Execute java and set the compaq.liblist system property to refer to the JavaLibList file
generated during the make operation. For example:
$ java -Dcompaq.liblist=\
/usr/tandem/java/bin/JavaLibList class-name
●
Edit the JavaLibList file, if necessary.
When make is invoked to link native libraries into the java executable, the Makefile creates a special file
called JavaLibList in the same directory as the java executable. The JavaLibList contains a list of
libraries known to be statically linked into the JVM just built with the exception that any .lib suffixes
have been replaced with .a. This file lists several internal libraries that should not be removed or changed.
The string a Java program passes to the System.loadLibrary method is assumed to correspond to an
actual file name of lib<string>.a. If the native library does not follow the naming convention of either
lib<string>.a or lib<string>.lib, then the Makefile does not create a correct entry for the
library. Therefore, you must edit the JavaLibList file such that each entry matches the format
lib<string>.a, where <string> is the value passed to the System.loadLibrary method. If the
native libraries do not follow the expected naming convention and the JavaLibList file is not edited,
then you get an incorrect UnsatisfiedLinkError exception when using the compaq.liblist
system property.
●
Linker and Compiler Options
Compiler Options
When you compile C++ source for use with NonStop Server for Java 4, you must use the following compiler
options to identify which dialect of the C++ compiler is to be used:
On TNS/R systems
-Wversion3
●
On TNS/E systems
-Wversion2 or
-Wversion3
●
On TNS/R systems only, never use the -Wcall_shared to compile JNI code because NonStop Server for Java 4
does not support DLLs on this platform.
In addition, for a compilation unit containing JNI code that has any floating-point parameters being passed across
the JNI boundary and that is directly called by the JVM, you must use the compiler option:
-WIEEE_float
Any compilation units not called directly by the JVM can be compiled without the –WIEEE_float option;
however, the complications that can occur while using such mixed modes are beyond the scope of this document.
However, the javahjni demo shows an example of mixed modes. (For information on demos, see
Demonstration Programs.)