javah - Generate C header or stub file
The javah
tool facilitates the implementation
of Java™ native
methods. It is compatible with the javah
tool that is supplied
by Sun Microsystems, Inc. with a few exceptions.
Note: | Writing native methods means that your application is not 100% pure Java. It also means that your application is not directly portable across platforms. Native methods are, by nature, platform or system specific. Using native methods may increase your development and maintenance costs for your applications. |
The javah
tool is available using the Qshell Interpreter.
It reads a Java class file and creates a C-language header file
in the current working directory. The header file that is written is a Stream
File (STMF). It must be copied to a file member before it can be included
in a C program on i5/OS.
The javah
tool is compatible
with the tool that is provided by Sun Microsystems, Inc. If the following
options are specified; however, the system ignores them:
Ignored option | Description |
---|---|
-td | The javah tool does not require a temporary directory. |
-stubs | Java on IBM® i only supports the Java Native Interface (JNI) form of native methods. Stubs were only required for the pre-JNI form of native methods. |
-trace | Relates to the .c stub file output, which Java on IBM i does not support. |
-v | Not supported. |
Note: | The -jni option must always be specified. The system does not support native method implementations before JNI. |