javah-java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64-debug (1) Linux Manual Page
javah – Generates C header and source files from a Java class.
Synopsis
javah [ options ] fully-qualified-class-name ...
- options
- The command-line options. See Options.
- fully-qualified-class-name
- The fully qualified location of the classes to be converted to C header and source files.
Description
The javah command generates C header and source files that are needed to implement native methods. The generated header and source files are used by C programs to reference an object’s instance variables from native source code. The .h file contains a struct definition with a layout that 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 declared within it are derived from the name of the class. When the class passed to the javah command is inside a package, the package name is added to the beginning of both the header file name and the structure name. Underscores (_) are used as name delimiters.
By default the javah command creates a header file for each class listed on the command line and puts the files in the current directory. Use the -stubs option to create source files. Use the -o option to concatenate the results for all listed classes into a single file.
The Java Native Interface (JNI) does not require header information or stub files. The javah command can still be used to generate native method function prototypes needed for JNI-style native methods. The javah command produces JNI-style output by default and places the result in the .h file.
Options
- -o outputfile
- Concatenates the resulting header or source files for all the classes listed on the command line into an output file. Only one of
-oor-dcan be used. - -d directory
- Sets the directory where the
javahcommand saves the header files or the stub files. Only one of-dor-ocan be used. - -stubs
- Causes the
javahcommand to generate C declarations from the Java object file. - -verbose
- Indicates verbose output and causes the
javahcommand to print a message tostdoutabout the status of the generated files. - -help
- Prints a help message for
javahusage. - -version
- Prints
javahcommand release information. - -jni
- Causes the
javahcommand to create an output file containing JNI-style native method function prototypes. This is the default output; use of-jniis optional. - -classpath path
- Specifies the path the
javahcommand uses to look up classes. Overrides the default or theCLASSPATHenvironment variable when it is set. Directories are separated by colons on Oracle Solaris and semicolons on Windows. The general format for path is:Oracle Solaris:
.:your-path
Example:
.:/home/avh/classes:/usr/local/java/classesWindows:
.;your-path
Example:
.;C:
