4176N/A." Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A."
0N/A." This code is free software; you can redistribute it and/or modify it
0N/A." under the terms of the GNU General Public License version 2 only, as
0N/A." published by the Free Software Foundation.
0N/A."
0N/A." This code is distributed in the hope that it will be useful, but WITHOUT
0N/A." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A." version 2 for more details (a copy is included in the LICENSE file that
0N/A." accompanied this code).
0N/A."
0N/A." You should have received a copy of the GNU General Public License version
0N/A." 2 along with this work; if not, write to the Free Software Foundation,
0N/A." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A."
2362N/A." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A." or visit www.oracle.com if you need additional information or have any
2362N/A." questions.
1178N/A."
4880N/A.TH javah 1 "16 Mar 2012"
0N/A
0N/A.LP
1178N/A.SH "Name"
0N/Ajavah \- C Header and Stub File Generator
0N/A.LP
0N/A.LP
0N/A\f3javah\fP produces C header files and C source files from a Java class. These files provide the connective glue that allow your Java and C code to interact.
0N/A.LP
0N/A.SH "SYNOPSIS"
0N/A.LP
0N/A.nf
0N/A\f3
0N/A.fl
0N/Ajavah [ \fP\f3options\fP\f3 ] fully\-qualified\-classname. . .
0N/A.fl
0N/A\fP
0N/A.fi
0N/A
0N/A.LP
0N/A.SH "DESCRIPTION"
0N/A.LP
0N/A.LP
0N/A\f3javah\fP 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 whose layout parallels the layout of the corresponding class. The fields in the struct correspond to instance variables in the class.
0N/A.LP
0N/A.LP
0N/AThe name of the header file and the structure declared within it are derived from the name of the class. If the class passed to \f3javah\fP 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.
0N/A.LP
0N/A.LP
0N/ABy default \f3javah\fP creates a header file for each class listed on the command line and puts the files in the current directory. Use the \f2\-stubs\fP option to create source files. Use the \f2\-o\fP option to concatenate the results for all listed classes into a single file.
0N/A.LP
0N/A.LP
0N/AThe new native method interface, Java Native Interface (JNI), does not require header information or stub files. \f3javah\fP can still be used to generate native method function proptotypes needed for JNI\-style native methods. \f3javah\fP produces JNI\-style output by default, and places the result in the .h file.
0N/A.LP
0N/A.SH "OPTIONS"
0N/A.LP
1178N/A.RS 3
0N/A.TP 3
0N/A\-o outputfile
0N/AConcatenates the resulting header or source files for all the classes listed on the command line into \f2outputfile\fP. Only one of \f3\-o\fP or \f3\-d\fP may be used.
0N/A.TP 3
0N/A\-d directory
0N/ASets the directory where \f3javah\fP saves the header files or the stub files. Only one of \f3\-d\fP or \f3\-o\fP may be used.
0N/A.TP 3
0N/A\-stubs
0N/ACauses \f3javah\fP to generate C declarations from the Java object file.
0N/A.TP 3
0N/A\-verbose
0N/AIndicates verbose output and causes \f3javah\fP to print a message to stdout concerning the status of the generated files.
0N/A.TP 3
0N/A\-help
0N/APrint help message for \f3javah\fP usage.
0N/A.TP 3
0N/A\-version
0N/APrint out \f3javah\fP version information.
0N/A.TP 3
0N/A\-jni
0N/ACauses \f3javah\fP to create an output file containing JNI\-style native method function prototypes. This is the default output, so use of \f3\-jni\fP is optional.
0N/A.TP 3
0N/A\-classpath path
0N/ASpecifies the path \f3javah\fP uses to look up classes. Overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for \f2path\fP is:
0N/A.nf
0N/A\f3
0N/A.fl
0N/A .:<your_path>
0N/A.fl
0N/A\fP
0N/A.fi
0N/AFor example:
0N/A.nf
0N/A\f3
0N/A.fl
0N/A .:/home/avh/classes:/usr/local/java/classes
0N/A.fl
0N/A\fP
0N/A.fi
0N/AAs a special convenience, a class path element containing a basename of \f2*\fP is considered equivalent to specifying a list of all the files in the directory with the extension \f2.jar\fP or \f2.JAR\fP (a java program cannot tell the difference between the two invocations).
0N/A.br
0N/A.br
4176N/AFor example, if directory \f2foo\fP contains \f2a.jar\fP and \f2b.JAR\fP, then the class path element \f2foo/*\fP is expanded to a \f2A.jar:b.JAR\fP, except that the order of jar files is unspecified. All jar files in the specified directory, even hidden ones, are included in the list. A classpath entry consisting simply of \f2*\fP expands to a list of all the jar files in the current directory. The \f2CLASSPATH\fP environment variable, where defined, will be similarly expanded. Any classpath wildcard expansion occurs before the Java virtual machine is started \-\- no Java program will ever see unexpanded wildcards except by querying the environment. For example; by invoking \f2System.getenv("CLASSPATH")\fP.
0N/A.TP 3
0N/A\-bootclasspath path
0N/ASpecifies path from which to load bootstrap classes. By default, the bootstrap classes are the classes implementing the core Java 2 platform located in \f2jre/lib/rt.jar\fP and several other jar files.
0N/A.TP 3
0N/A\-old
0N/ASpecifies that old JDK1.0\-style header files should be generated.
0N/A.TP 3
0N/A\-force
0N/ASpecifies that output files should always be written.
0N/A.TP 3
0N/A\-Joption
1178N/APass \f2option\fP to the Java virtual machine, where \f2option\fP is one of the options described on the reference page for the java(1). For example, \f3\-J\-Xms48m\fP sets the startup memory to 48 megabytes.
1178N/A.RE
1178N/A
0N/A.LP
0N/A.SH "ENVIRONMENT VARIABLES"
0N/A.LP
1178N/A.RS 3
0N/A.TP 3
0N/ACLASSPATH
0N/AUsed to provide the system a path to user\-defined classes. Directories are separated by colons, for example,
0N/A.nf
0N/A\f3
0N/A.fl
0N/A.:/home/avh/classes:/usr/local/java/classes
0N/A.fl
0N/A\fP
0N/A.fi
1178N/A.RE
0N/A
0N/A.LP
0N/A.SH "SEE ALSO"
0N/A.LP
0N/A.LP
1178N/Ajavac(1), java(1), jdb(1), javap(1), javadoc(1)
0N/A.LP
0N/A