1 '\" t |
|
2 .\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. |
|
3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 .\" |
|
5 .\" This code is free software; you can redistribute it and/or modify it |
|
6 .\" under the terms of the GNU General Public License version 2 only, as |
|
7 .\" published by the Free Software Foundation. |
|
8 .\" |
|
9 .\" This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 .\" version 2 for more details (a copy is included in the LICENSE file that |
|
13 .\" accompanied this code). |
|
14 .\" |
|
15 .\" You should have received a copy of the GNU General Public License version |
|
16 .\" 2 along with this work; if not, write to the Free Software Foundation, |
|
17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 .\" |
|
19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 .\" or visit www.oracle.com if you need additional information or have any |
|
21 .\" questions. |
|
22 .\" |
|
23 .\" Arch: generic |
|
24 .\" Software: JDK 8 |
|
25 .\" Date: 21 November 2013 |
|
26 .\" SectDesc: Basic Tools |
|
27 .\" Title: javah.1 |
|
28 .\" |
|
29 .if n .pl 99999 |
|
30 .TH javah 1 "21 November 2013" "JDK 8" "Basic Tools" |
|
31 .\" ----------------------------------------------------------------- |
|
32 .\" * Define some portability stuff |
|
33 .\" ----------------------------------------------------------------- |
|
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
35 .\" http://bugs.debian.org/507673 |
|
36 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
|
37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
38 .ie \n(.g .ds Aq \(aq |
|
39 .el .ds Aq ' |
|
40 .\" ----------------------------------------------------------------- |
|
41 .\" * set default formatting |
|
42 .\" ----------------------------------------------------------------- |
|
43 .\" disable hyphenation |
|
44 .nh |
|
45 .\" disable justification (adjust text to left margin only) |
|
46 .ad l |
|
47 .\" ----------------------------------------------------------------- |
|
48 .\" * MAIN CONTENT STARTS HERE * |
|
49 .\" ----------------------------------------------------------------- |
|
50 |
|
51 .SH NAME |
|
52 javah \- Generates C header and source files from a Java class\&. |
|
53 .SH SYNOPSIS |
|
54 .sp |
|
55 .nf |
|
56 |
|
57 \fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR |
|
58 .fi |
|
59 .sp |
|
60 .TP |
|
61 \fIoptions\fR |
|
62 The command-line options\&. See Options\&. |
|
63 .TP |
|
64 \fIfully-qualified-class-name\fR |
|
65 The fully qualified location of the classes to be converted to C header and source files\&. |
|
66 .SH DESCRIPTION |
|
67 The \f3javah\fR 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 \f3\&.h\fR file contains a \f3struct\fR definition with a layout that parallels the layout of the corresponding class\&. The fields in the \f3struct\fR correspond to instance variables in the class\&. |
|
68 .PP |
|
69 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 \f3javah\fR 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\&. |
|
70 .PP |
|
71 By default the \f3javah\fR command creates a header file for each class listed on the command line and puts the files in the current directory\&. Use the \f3-stubs\fR option to create source files\&. Use the \f3-o\fR option to concatenate the results for all listed classes into a single file\&. |
|
72 .PP |
|
73 The Java Native Interface (JNI) does not require header information or stub files\&. The \f3javah\fR command can still be used to generate native method function prototypes needed for JNI-style native methods\&. The \f3javah\fR command produces JNI-style output by default and places the result in the \f3\&.h\fR file\&. |
|
74 .SH OPTIONS |
|
75 .TP |
|
76 -o \fIoutputfile\fR |
|
77 .br |
|
78 Concatenates the resulting header or source files for all the classes listed on the command line into an output file\&. Only one of \f3-o\fR or \f3-d\fR can be used\&. |
|
79 .TP |
|
80 -d \fIdirectory\fR |
|
81 .br |
|
82 Sets the directory where the \f3javah\fR command saves the header files or the stub files\&. Only one of \f3-d\fR or \f3-o\fR can be used\&. |
|
83 .TP |
|
84 -stubs |
|
85 .br |
|
86 Causes the \f3javah\fR command to generate C declarations from the Java object file\&. |
|
87 .TP |
|
88 -verbose |
|
89 .br |
|
90 Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&. |
|
91 .TP |
|
92 -help |
|
93 .br |
|
94 Prints a help message for \f3javah\fR usage\&. |
|
95 .TP |
|
96 -version |
|
97 .br |
|
98 Prints \f3javah\fR command release information\&. |
|
99 .TP |
|
100 -jni |
|
101 .br |
|
102 Causes the \f3javah\fR command to create an output file containing JNI-style native method function prototypes\&. This is the default output; use of \f3-jni\fR is optional\&. |
|
103 .TP |
|
104 -classpath \fIpath\fR |
|
105 .br |
|
106 Specifies the path the \f3javah\fR command uses to look up classes\&. Overrides the default or the \f3CLASSPATH\fR environment variable when it is set\&. Directories are separated by colons on Oracle Solaris and semicolons on Windows\&. The general format for path is: |
|
107 |
|
108 \fIOracle Solaris\fR: |
|
109 |
|
110 \&.:\fIyour-path\fR |
|
111 |
|
112 Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR |
|
113 |
|
114 \fIWindows\fR: |
|
115 |
|
116 \&.;\fIyour-path\fR |
|
117 |
|
118 Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR |
|
119 |
|
120 As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension \f3\&.jar\fR or \f3\&.JAR\fR\&. |
|
121 |
|
122 For example, if directory \f3mydir\fR contains \f3a\&.jar\fR and \f3b\&.JAR\fR, then the class path element \f3mydir/*\fR is expanded to a \f3A\fR\f3\&.jar:b\&.JAR\fR, except that the order of jar files is unspecified\&. All JAR files in the specified directory, including hidden ones, are included in the list\&. A class path entry that consists of * expands to a list of all the JAR files in the current directory\&. The \f3CLASSPATH\fR environment variable, where defined, is similarly expanded\&. Any class path wild card expansion occurs before the Java Virtual Machine (JVM) is started\&. A Java program will never see unexpanded wild cards except by querying the environment\&. For example, by calling \f3System\&.getenv("CLASSPATH")\fR\&. |
|
123 .TP |
|
124 -bootclasspath \fIpath\fR |
|
125 .br |
|
126 Specifies the path from which to load bootstrap classes\&. By default, the bootstrap classes are the classes that implement the core Java platform located in \f3jre\elib\ert\&.jar\fR and several other JAR files\&. |
|
127 .TP |
|
128 -old |
|
129 .br |
|
130 Specifies that old JDK 1\&.0-style header files should be generated\&. |
|
131 .TP |
|
132 -force |
|
133 .br |
|
134 Specifies that output files should always be written\&. |
|
135 .TP |
|
136 -J\fIoption\fR |
|
137 .br |
|
138 Passes \f3option\fR to the Java Virtual Machine, where \f3option\fR is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&. |
|
139 .SH SEE\ ALSO |
|
140 .TP 0.2i |
|
141 \(bu |
|
142 javah(1) |
|
143 .TP 0.2i |
|
144 \(bu |
|
145 java(1) |
|
146 .TP 0.2i |
|
147 \(bu |
|
148 jdb(1) |
|
149 .TP 0.2i |
|
150 \(bu |
|
151 javap(1) |
|
152 .TP 0.2i |
|
153 \(bu |
|
154 javadoc(1) |
|
155 .RE |
|
156 .br |
|
157 'pl 8.5i |
|
158 'bp |
|