Getting started with Java native methods
You should only use native methods in cases where pure Java™ cannot meet your programming needs.
Limit the use of native methods by only using them under
these circumstances:
- To access system functions that are not available using pure Java.
- To implement performance-sensitive methods that can benefit significantly from a native implementation.
- To interface to existing application programming interfaces (API) that allow Java to call other APIs.
The following instructions apply to using the Java Native Interface (JNI) with the C language. For information about using JNI with the RPG language, see Chapter 11 of the WebSphere® Development Studio: ILE RPG Programmer's Guide, SC09-2507.
Note: The term
native library or native method library refers to integrated language
environment (ILE) service programs when used in the context of ILE
native methods, and AIX® static
or shared libraries when used in the context of PASE for i native methods.
To create Java native methods, do these steps:
For an example of an ILE native method, see Example: ILE native method for Java. For an example of a PASE for i native method, see Example: IBM PASE for i native method for Java.