Stefan Bodewig b6a3e9df36 License police on documentation files:
(1) Make sure there is a Copyright notice on all visible files.

(2) Make sure all years in which the file has been modified are
listed.

(3) Make sure the format is consistent, i.e. separate consecutive
years with a dash, not a comma.

When Stephane changed starteam.html it has been 2001 in France but
2002 in Australia - does that mean we add 2002 to the Copyright line
or not?  ;-)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270652 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 08:48:33 +00:00

121 lines
4.7 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Apache Ant</title>
</head>
<body>
<h2><a name="zip">Javah</a></h2>
<h3>Description</h3>
<p>Generates JNI headers from a Java class.</p>
<p> When this task executes, it will generate the C header and source files that
are needed to implement native methods. JNI operates differently depending on
whether <a href="http://java.sun.com/j2se/1.3/docs/tooldocs/win32/javah.html">JDK1.2</a>
(or later) or <a href="http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html">pre-JDK1.2</a>
systems are used.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
<td valign="top"><b>Attribute</b></td>
<td valign="top"><b>Description</b></td>
<td valign="top" align="center"><b>Required</b></td>
</tr>
<tr>
<td valign="top">class</td>
<td valign="top">the fully-qualified name of the class (or classes,
separated by commas)</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
<td valign="top">outputFile</td>
<td valign="top">concatenates the resulting header or source files for all the classes listed into this file</td>
<td align="center" valign="middle" rowspan="2">Yes</td>
</tr>
<tr>
<td valign="top">destdir</td>
<td valign="top">sets the directory where javah saves the header files or the
stub files.</td>
</tr>
<tr>
<td valign="top">force</td>
<td valign="top">specifies that output files should always be written (JDK1.2 only)</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">old</td>
<td valign="top">specifies that old JDK1.0-style header files should be generated
(otherwise output file contain JNI-style native method function prototypes) (JDK1.2 only)</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">stubs</td>
<td valign="top">generate C declarations from the Java object file (used with old)</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">verbose</td>
<td valign="top">causes Javah to print a message concerning the status of the generated files</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">classpath</td>
<td valign="top">the classpath to use.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">bootclasspath</td>
<td valign="top">location of bootstrap class files.</td>
<td valign="top" align="center">No</td>
</tr>
<tr>
<td valign="top">extdirs</td>
<td valign="top"> location of installed extensions.</td>
<td valign="top" align="center">No</td>
</tr>
</table>
<p>Either outputFile or destdir must be supplied, but not both.&nbsp;</p>
<h3>Examples</h3>
<pre> &lt;javah destdir=&quot;c&quot; class=&quot;org.foo.bar.Wibble&quot; /&gt;</pre>
<p>makes a JNI header of the named class, using the JDK1.2 JNI model. Assuming
the directory 'c' already exists, the file <tt>org_foo_bar_Wibble.h</tt>
is created there. If this file already exists, it is left unchanged.</p>
<pre> &lt;javah outputFile=&quot;wibble.h&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble,org.foo.bar.Bobble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>is similar to the previous example, except the output is written to a file
called <tt>wibble.h</tt>
in the current directory.</p>
<pre> &lt;javah destdir=&quot;c&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes three header files, one for each of the classes named. Because the
force option is set, these header files are always written when the Javah task
is invoked, even if they already exist.</p>
<pre> &lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;
&lt;javah destdir=&quot;c&quot; verbose=&quot;yes&quot; stubs=&quot;yes&quot; old=&quot;yes&quot; force=&quot;yes&quot;&gt;
&lt;class name=&quot;org.foo.bar.Wibble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Bobble&quot;/&gt;
&lt;class name=&quot;org.foo.bar.Tribble&quot;/&gt;
&lt;/javah&gt;</pre>
<p>writes the headers for the three classes using the 'old' JNI format, then
writes the corresponding .c stubs. The verbose option will cause Javah to
describe its progress.</p>
<hr>
<hr>
<p align="center">Copyright &copy; 2001 Apache Software Foundation. All rights
Reserved.</p>
</body>
</html>