NonStop Server for Java 5.0 Programmer's Reference
thread by specifying the -Xss option when starting java. This option increases the stack size for every
thread. For more information about the -Xss option, see java in the NonStop Server for Java Tools
Reference Pages.
Create a DLL file (.so file type) and specify the linker option -set floattype IEEE_float. Then
set the _RLD_LIB_PATH environment variable to point to where the created DLL file resides by using the
following command:
export _RLD_LIB_PATH=dll-path
where dll-path is the directory where the user DLL resides. For more information, see
_RLD_LIB_PATH.
4.
The javahjni demo shows an example of how to create a library file. This demo also shows converting between
TNS and IEEE floating point.
Calling Java Methods from C or C++
You can create your own C or C++ program and use the Invocation API to load the JVM into an arbitrary native
program. Be sure to follow these guidelines:
Compile code written in C++ by using the -Wversion2 or -Wversion3 compiler, and the
-WIEEE_float compiler command-line options.
●
The NonStop Server for Java 5 provides DLLs. Therefore, you build your own executable and link that
executable against the JVM DLL, libjvm.so. You must also take additional steps to make sure that the
NonStop Server for Java version of the Pthreads library is used rather than the public Pthreads library. For
details, see the invocation_api demo provided with the NonStop Server for Java 5 installation.
●
Do not set signal handlers for the following signals: SIGSEGV, SIGPIPE, SIGCHLD, SIGINT, SIGQUIT,
SIGTERM, and SIGHUP.
●
Set the executable to use IEEE floating point.●
NonStop Server for Java 5 does not support the signal-chaining facility implemented in some other vendors' JVMs.
When a program uses the Invocation API to start a JVM, its function returns are parameters of type float or
double that are in IEEE floating-point format. Any parameters of type float or double that are passed to
NonStop Server for Java 5 must also be in IEEE floating-point format. If such a program wants to convert between
TNS floating-point format and IEEE floating-point format, the Guardian Procedure Calls Manual documents a
series of procedures with names beginning with NSK_FLOAT_ that can be used to convert float and double
data between the two formats.
To run the Invocation API demo, follow the instructions for the Invocation API demo in the README file in the
directory /usr/tandem/java/demo/invocation_api.
Linker and Compiler Options
Compiler Options
When you compile C++ source for use with NonStop Server for Java 5, you must use the following compiler
options to identify which dialect of the C++ compiler is to be used:
-Wversion2 or
-Wversion3
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:










