Example: ILE native method for Java

The integrated language environment (ILE) native method for Java™ example calls an instance of a native C method that then uses Java Native Interface (JNI) to call back into Java code to set the value of a Java string variable. The Java string variable is then written to standard out by the Java code.

To see HTML versions of the example source files, use the following links:

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

Before you can run the ILE native method example, you must complete the tasks in the following topics:

  1. Example: Preparing the ILE native method source code
  2. Example: Creating the ILE native method program objects

Running the ILE native method for Java example

After you complete the previous tasks, you can run the example. Use either of the following commands to run the example program:

  • From an IBM® i command prompt:
         JAVA CLASS(NativeHello) CLASSPATH('/ileexample')
  • From a Qshell command prompt:
         cd /ileexample
         java NativeHello