javah

javah produces C header files and C stub files from an Java class file.

SYNOPSIS

javah [ options ] classname. . .

javah_g [ options ] classname. . .

DESCRIPTION

javah generates headers and stubs that are needed to implement native methods. The header (.h) files created are used by C programs to reference class instance variables. The .h file contains a struct definition whose layout parallels the layout of the corresponding class. The fields in the struct correspond to instance variables in the class.

The name of the header file and the structure that is declared are derived from the name of the class. If the class passed to javah is inside a package the package name is prepended to both the header file name and the structure name. Underscores (_) are used as name delimiters.

By default javah creates a subdirectory, called "CClassHeaders", where it saves the header files it creates. If the -stubs option is used, javah creates a directory named "stubs" and saves the stub file there.

javah_g is a non-optimized version of javah suitable for use with debuggers like dbx or gdb.

OPTIONS

-d directory
Overrides the default directory where javah saves the header files or the stub files.

-td directory
Overrides the default directory where javah stores temporary files. The default is /tmp.

-stubs
Causes javah to generate stub declarations from the Java object file.

-verbose
Causes javah to print a message to stdout concerning the status of the generated files.

-classpath path
Specifies the path javah uses to look up classes. Overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by semicolons. Thus the general format for path is:
    .;<your_path>

For example:

    .;C:\users\lindholm\classes;D:\java\classes

ENVIRONMENT VARIABLES

CLASSPATH
Used to provide the system a path to user-defined classes. Directories are separated by semicolons, for example,
    .;C:\users\lindholm\classes;D:\java\classes

SEE ALSO

java, javac, javaprof, javap, javadoc The Java Language Specification, The JAVA Virtual Machine Specification