
94 Java Stand-alone Applications on z/OS Volume II
6.2.1 Developing a simple JNI program
Figure 6-5 and Figure 6-6 on page 95 show two simple sources that make up an
JNI program. We will use this section to guide you through the basic steps of
developing a JNI program.
Figure 6-5 shows the source of our HelloWorld Java application. It declares a
native method and implements the main method.
This native method is the piece that we want to write in C. Therefore, we use the
keyword native as shown in [1]. The statement System.loadLibrary, indicated
by [2], loads the shared library (or DLL) containing our native method
implementation.
In order f ...