Name

javah

Synopsis

    javah [options] classes |files

Generate C header and/or source files for implementing native methods. The generated .h file defines a structure whose members parallel those of the corresponding Java class.

The header filename is derived from the corresponding Java class. If the class is inside a package, the package name is prepended to the filename and the structure name, separated by an underscore.

Note: the Java Native Interface (JNI) does not require header or stub files. Use the -jni option to create function prototypes for JNI native methods.

Options

-bootclasspath path

Use the colon-separated list of directories in path for the boot classes, instead of the boot classes used by the java command itself.

-classpath path

Use the colon-separated list of directories in path instead of $CLASSPATH to find class files. It is usually a good idea to have the current directory (“.”) on the search path.

-d dir

Place generated files in dir.

-force

Always write output files.

-help

Print a help message.

-J java-option

Pass java-option on to the java program. Useful for changing the execution environment or memory usage. java-option should not contain spaces; use multiple -J options if necessary.

-jni

Produce JNI native method function prototypes.

-o file

Concatenate all generated header or source files for all the classes and write them to file.

-old

Produce JDK 1.0-style headers.

-stubs

Generate C declarations, not headers.

-trace

Add tracing information to the generated ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.