21743
|
1 |
'\" t
|
|
2 |
.\" Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
.\"
|
|
4 |
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
5 |
.\"
|
|
6 |
.\" This code is free software; you can redistribute it and/or modify it
|
|
7 |
.\" under the terms of the GNU General Public License version 2 only, as
|
|
8 |
.\" published by the Free Software Foundation.
|
|
9 |
.\"
|
|
10 |
.\" This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
.\" version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
.\" accompanied this code).
|
|
15 |
.\"
|
|
16 |
.\" You should have received a copy of the GNU General Public License version
|
|
17 |
.\" 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
.\"
|
|
20 |
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
.\" or visit www.oracle.com if you need additional information or have any
|
|
22 |
.\" questions.
|
|
23 |
.\"
|
|
24 |
.\" Arch: generic
|
|
25 |
.\" Software: JDK 8
|
|
26 |
.\" Date: 21 November 2013
|
|
27 |
.\" SectDesc: Basic Tools
|
|
28 |
.\" Title: javah.1
|
|
29 |
.\"
|
|
30 |
.if n .pl 99999
|
|
31 |
.TH javah 1 "21 November 2013" "JDK 8" "Basic Tools"
|
|
32 |
.\" -----------------------------------------------------------------
|
|
33 |
.\" * Define some portability stuff
|
|
34 |
.\" -----------------------------------------------------------------
|
|
35 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
36 |
.\" http://bugs.debian.org/507673
|
|
37 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
|
38 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
39 |
.ie \n(.g .ds Aq \(aq
|
|
40 |
.el .ds Aq '
|
|
41 |
.\" -----------------------------------------------------------------
|
|
42 |
.\" * set default formatting
|
|
43 |
.\" -----------------------------------------------------------------
|
|
44 |
.\" disable hyphenation
|
|
45 |
.nh
|
|
46 |
.\" disable justification (adjust text to left margin only)
|
|
47 |
.ad l
|
|
48 |
.\" -----------------------------------------------------------------
|
|
49 |
.\" * MAIN CONTENT STARTS HERE *
|
|
50 |
.\" -----------------------------------------------------------------
|
2
|
51 |
|
21743
|
52 |
.SH NAME
|
|
53 |
javah \- Generates C header and source files from a Java class\&.
|
|
54 |
.SH SYNOPSIS
|
|
55 |
.sp
|
|
56 |
.nf
|
2
|
57 |
|
21743
|
58 |
\fBjavah\fR [ \fIoptions\fR ] f\fIully\-qualified\-class\-name \&.\&.\&.\fR
|
|
59 |
.fi
|
|
60 |
.sp
|
|
61 |
.TP
|
|
62 |
\fIoptions\fR
|
|
63 |
The command-line options\&. See Options\&.
|
|
64 |
.TP
|
|
65 |
\fIfully-qualified-class-name\fR
|
|
66 |
The fully qualified location of the classes to be converted to C header and source files\&.
|
|
67 |
.SH DESCRIPTION
|
|
68 |
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\&.
|
|
69 |
.PP
|
|
70 |
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\&.
|
|
71 |
.PP
|
|
72 |
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\&.
|
|
73 |
.PP
|
|
74 |
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\&.
|
|
75 |
.SH OPTIONS
|
|
76 |
.TP
|
|
77 |
-o \fIoutputfile\fR
|
|
78 |
.br
|
|
79 |
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\&.
|
|
80 |
.TP
|
|
81 |
-d \fIdirectory\fR
|
|
82 |
.br
|
|
83 |
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\&.
|
|
84 |
.TP
|
|
85 |
-stubs
|
|
86 |
.br
|
|
87 |
Causes the \f3javah\fR command to generate C declarations from the Java object file\&.
|
|
88 |
.TP
|
|
89 |
-verbose
|
|
90 |
.br
|
|
91 |
Indicates verbose output and causes the \f3javah\fR command to print a message to \f3stdout\fR about the status of the generated files\&.
|
|
92 |
.TP
|
|
93 |
-help
|
|
94 |
.br
|
|
95 |
Prints a help message for \f3javah\fR usage\&.
|
|
96 |
.TP
|
|
97 |
-version
|
|
98 |
.br
|
|
99 |
Prints \f3javah\fR command release information\&.
|
|
100 |
.TP
|
|
101 |
-jni
|
|
102 |
.br
|
|
103 |
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\&.
|
|
104 |
.TP
|
|
105 |
-classpath \fIpath\fR
|
2
|
106 |
.br
|
21743
|
107 |
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:
|
|
108 |
|
|
109 |
\fIOracle Solaris\fR:
|
|
110 |
|
|
111 |
\&.:\fIyour-path\fR
|
|
112 |
|
|
113 |
Example: \f3\&.:/home/avh/classes:/usr/local/java/classes\fR
|
|
114 |
|
|
115 |
\fIWindows\fR:
|
|
116 |
|
|
117 |
\&.;\fIyour-path\fR
|
|
118 |
|
|
119 |
Example: \f3\&.;C:\eusers\edac\eclasses;C:\etools\ejava\eclasses\fR
|
|
120 |
|
|
121 |
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\&.
|
2692
|
122 |
|
21743
|
123 |
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\&.
|
|
124 |
.TP
|
|
125 |
-bootclasspath \fIpath\fR
|
|
126 |
.br
|
|
127 |
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\&.
|
|
128 |
.TP
|
|
129 |
-old
|
|
130 |
.br
|
|
131 |
Specifies that old JDK 1\&.0-style header files should be generated\&.
|
|
132 |
.TP
|
|
133 |
-force
|
|
134 |
.br
|
|
135 |
Specifies that output files should always be written\&.
|
|
136 |
.TP
|
|
137 |
-J\fIoption\fR
|
|
138 |
.br
|
|
139 |
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)\&.
|
|
140 |
.SH SEE\ ALSO
|
|
141 |
.TP 0.2i
|
|
142 |
\(bu
|
|
143 |
javah(1)
|
|
144 |
.TP 0.2i
|
|
145 |
\(bu
|
|
146 |
java(1)
|
|
147 |
.TP 0.2i
|
|
148 |
\(bu
|
|
149 |
jdb(1)
|
|
150 |
.TP 0.2i
|
|
151 |
\(bu
|
|
152 |
javap(1)
|
|
153 |
.TP 0.2i
|
|
154 |
\(bu
|
|
155 |
javadoc(1)
|
|
156 |
.RE
|
|
157 |
.br
|
|
158 |
'pl 8.5i
|
|
159 |
'bp
|