![]()
|
JavahDescriptionGenerates JNI headers from a Java class. 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 JDK1.2 (or later) or pre-JDK1.2 systems are used. Parameters
Either outputFile or destdir must be supplied, but not both. Examples<javah destdir="c" class="org.foo.bar.Wibble"/> makes a JNI header of the named class, using the JDK1.2 JNI model. Assuming the directory 'c' already exists, the file org_foo_bar_Wibble.h is created there. If this file already exists, it is left unchanged. <javah outputFile="wibble.h"> <class name="org.foo.bar.Wibble,org.foo.bar.Bobble"/> </javah> is similar to the previous example, except the output is written to a file called wibble.h in the current directory. <javah destdir="c" force="yes"> <class name="org.foo.bar.Wibble"/> <class name="org.foo.bar.Bobble"/> <class name="org.foo.bar.Tribble"/> </javah> 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. <javah destdir="c" verbose="yes" old="yes" force="yes"> <class name="org.foo.bar.Wibble"/> <class name="org.foo.bar.Bobble"/> <class name="org.foo.bar.Tribble"/> </javah> <javah destdir="c" verbose="yes" stubs="yes" old="yes" force="yes"> <class name="org.foo.bar.Wibble"/> <class name="org.foo.bar.Bobble"/> <class name="org.foo.bar.Tribble"/> </javah> 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. Copyright © 2001-2002 Apache Software Foundation. All rights Reserved. |