'\" t .\" @(#)javah.1 1.7 99/02/19 SMI; .\" Copyright 1999 Sun Microsystems, Inc. All rights reserved. .\" Copyright 1999 Sun Microsystems, Inc. Tous droits réservés. .\" '\"macro stdmacro .TH javah 1 "18 Feb 1999" .SH NAME javah \- C header and stub file generator .\" .\" This document was created by saving an HTML file as text .\" from the JavaSoft web site: .\" .\" http://java.sun.com/products/jdk/1.2/docs/tooldocs/tools.html .\" .\" and adding appropriate troff macros. Because the JavaSoft web site .\" man pages can change without notice, it may be helpful to diff .\" files to identify changes other than new functionality. .\" .SH SYNOPSIS .B javah [ .B options ] .I fully-qualified-classname . . . .br .B javah_g [ .B options ] .I fully-qualified-classname . . . .SH DESCRIPTION .IX "stub file generator" "" "stub file generator \(em \fLjavah\fP" .IX "C header and stub file generator" "" "C header and stub file generator \(em \fLjavah\fP" .IX "javah" "" "\fLjavah\fP \(em C header and stub file generator" The .B 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 instance variables of an object from native source code. The .B .h file contains a structure definition whose layout parallels that of the corresponding class. The fields in the structure correspond to instance variables in the class. .LP The name of the header file and the structure declared within it are derived from the name of the class. If the class passed to .B 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. .LP By default, .B javah creates a header file for each class listed on the command line and puts the files in the current directory. Use the .B \-stubs option to create source files. Use the .B \-o option to concatenate the results for all listed classes into a single file. .LP The new native method interface, Java\(tm Native Interface (JNI), does not require header information or stub files. The .B javah command can still be used to generate native method function prototypes needed for JNI-style native methods. .B javah produces JNI-style output by default, and places the result in the .B .h file. .LP The .B javah_g version is a non-optimized version of .B javah suitable for use with debuggers like .BR jdb . .SH OPTIONS The following options are supported: .TP 15 .BI \-bootclasspath " path" Specifies path from which to load bootstrap classes. By default, the bootstrap classes are the classes implementing the core Java platform located in .B jre/lib/rt.jar and .BR jre/lib/i18n.jar . .TP 15 .BI \-classpath " path" Specifies the path .B javah uses to look up classes. Overrides the default of the .SB CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for path is: .RS 20 .sp 1n .B .: .sp 1n .RE .RS 15 For example: .RE .RS 20 .sp 1n .B .:/home/avh/classes:/usr/local/java/classes .sp 1n .RE .TP 15 .BI \-d " directory" Sets the directory where .B javah saves the header files or the stub files. .TP 15 .B \-force Specifies that output files should always be written. .TP 15 .B \-help Prints help message for .B javah usage. .TP 15 .B \-jni Causes .B javah to create an output file containing JNI-style native method function prototypes. This is the default output so use of -B \-jni is optional. .TP 15 .BI \-o " outputfile" Concatenates the resulting header or source files for all the classes listed on the command line into .BR outputfile . Only the .B \-o or .B \-d option may be used. .TP 15 .B \-old Specifies the old JDK1.0-style header files should be generated. .TP 15 .B \-stubs Causes .B javah to generate C declarations from the Java object file. Only the .B \-o or .B \-d option may be used. .TP 15 .B \-trace Adds tracing information to the stubs file. .TP 15 .B \-verbose Indicates verbose output and causes .B javah to print a message to .B stdout concerning the status of the generated files. .TP 15 .B \-version Prints build version. .SH ENVIRONMENT VARIABLES .TP 15 .SB CLASSPATH Used to provide the system with a path to user-defined classes. Directories are separated by colons, for example, .RS 20 .sp 1n .B .:/home/avh/classes:/usr/local/java/classes .RE .SH ATTRIBUTES See .BR attributes (5) for a description of the following attributes: .sp .TS box; cbp-1 | cbp-1 l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE = Availability SUNWjvdev .TE .SH SEE ALSO .BR java (1), .BR javac (1), .BR javadoc (1), .BR javap (1), .BR jdb (1), .BR attributes (5)