home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / man / sman1 / javah.1 < prev    next >
Encoding:
Text File  |  2002-09-06  |  9.3 KB  |  175 lines

  1. <!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD DocBook V3.0-Based SolBook Subset V2.0//EN" [
  2. <!--ArborText, Inc., 1988-1999, v.4002-->
  3. <!ENTITY % javaents SYSTEM "javaman.ent">
  4. %javaents;
  5. ]>
  6. <?Pub UDT _bookmark _target>
  7. <?Pub Inc>
  8. <refentry id="javah-1">
  9. <!--@(#)javah.1 1.12 01/03/14 SMI;-->
  10. <refmeta><refentrytitle>javah</refentrytitle><manvolnum>1</manvolnum>
  11. <refmiscinfo class="date">23 Apr 2001</refmiscinfo>
  12. <refmiscinfo class="sectdesc">&man1;</refmiscinfo>
  13. <refmiscinfo class="software">&java-release;</refmiscinfo>
  14. <refmiscinfo class="arch">generic</refmiscinfo>
  15. <refmiscinfo class="copyright"> Copyright 2001 Sun Microsystems, Inc. All
  16. rights reserved.  Copyright 2001 Sun Microsystems, Inc. Tous droits réservés.
  17.  </refmiscinfo>
  18. </refmeta>
  19. <refnamediv><refname>javah</refname><refpurpose>C header and stub file generator
  20. </refpurpose></refnamediv>
  21. <refsynopsisdiv><title>&synp-tt;</title>
  22. <cmdsynopsis><command>javah</command><arg choice="opt">options</arg><arg choice="plain"
  23. rep="repeat"><replaceable>fully-qualified-classname</replaceable></arg>
  24. </cmdsynopsis>
  25. <cmdsynopsis><command>javah_g</command><arg choice="opt">options</arg><arg
  26. choice="plain" rep="repeat"><replaceable>fully-qualified-classname</replaceable></arg>
  27. </cmdsynopsis></refsynopsisdiv>
  28. <refsect1><title>&desc-tt;</title>
  29. <indexterm id="javah-1-indx-1"><primary sortas="stub file generator">stub
  30. file generator — javah</primary></indexterm><indexterm id="javah-1-indx-2">
  31. <primary sortas="C header and stub file generator">C header and stub file
  32. generator — javah</primary></indexterm><indexterm id="javah-1-indx-3">
  33. <primary sortas="javah">javah — C header and stub file generator</primary>
  34. </indexterm><para>The <command>javah</command> command generates C header
  35. and source files that are needed to implement native methods. The generated
  36. header and source files are used by C programs to reference instance variables
  37. of an object from native source code. The <literal>.h</literal> file contains
  38. a structure definition whose layout parallels that of the corresponding class.
  39. The fields in the structure correspond to instance variables in the class.
  40. </para>
  41. <para>The name of the header file and the structure declared within it are
  42. derived from the name of the class. If the class passed to <command>javah
  43. </command> is inside a package, the package name is prepended to both the
  44. header file name and the structure name. Underscores ( _ ) are used as name
  45. delimiters.</para>
  46. <para>By default, <command>javah</command> creates a header file for each
  47. class listed on the command line and puts the files in the current directory.
  48. Use the <option>stubs</option> option to create source files. Use the <option>
  49. o</option> option to concatenate the results for all listed classes into a
  50. single file.</para>
  51. <para>The new native method interface, Java™ Native Interface (JNI),
  52. does not require header information or stub files. The <command>javah</command>
  53. command can still be used  to generate native method function prototypes needed
  54. for JNI-style native methods. <command>javah</command> produces JNI-style
  55. output by default and places the result in the <literal>.h</literal> file.
  56. </para>
  57. <para>The <command>javah_g</command> version is a non-optimized version of <command>
  58. javah</command> suitable for use with debuggers like <command>jdb</command>. 
  59. </para>
  60. </refsect1>
  61. <refsect1><title>&opts-tt;</title>
  62. <para>The following options are supported:</para>
  63. <variablelist termlength="medium">
  64. <varlistentry><term remap="15"><option>bootclasspath</option> <replaceable>
  65. path</replaceable></term><listitem><para>Specifies path from which to load
  66. bootstrap classes. By default, the bootstrap classes are the classes implementing
  67. the core Java platform located in <filename>jre/lib/rt.jar</filename> and
  68. other important jar files<?Pub Caret>. </para>
  69. </listitem></varlistentry>
  70. <varlistentry><term remap="15"><option>classpath</option> <replaceable>path
  71. </replaceable></term><listitem><para>Specifies the path <command>javah</command>
  72. uses to look up classes. Overrides the default of the <envar>CLASSPATH</envar>
  73. environment variable if it is set. Directories are separated by colons. Thus,
  74. the general format for path is: <informalexample><para><literal>.:</literal><replaceable>
  75. your_path</replaceable> </para>
  76. </informalexample> <informalexample><para>For example:</para>
  77. </informalexample> <informalexample><para><literal>.:/home/avh/classes:/usr/local/java/classes
  78. </literal> </para>
  79. </informalexample></para>
  80. </listitem></varlistentry>
  81. <varlistentry><term remap="15"><option>d</option> <replaceable>directory</replaceable></term>
  82. <listitem><para>Sets the directory where <command>javah</command> saves the
  83. header files or the stub files.</para>
  84. </listitem></varlistentry>
  85. <varlistentry><term remap="15"><option>force</option></term><listitem><para>
  86. Specifies that output files should always be written.</para>
  87. </listitem></varlistentry>
  88. <varlistentry><term remap="15"><option>help</option></term><listitem><para>
  89. Prints help message for <command>javah</command> usage.</para>
  90. </listitem></varlistentry>
  91. <varlistentry><term remap="15"><option>jni</option></term><listitem><para>
  92. Causes <command>javah</command> to create an output file containing JNI-style
  93. native method function prototypes. This is the default output, so use of <option>
  94. jni</option> is optional.</para>
  95. </listitem></varlistentry>
  96. <varlistentry><term remap="15"><option>o</option> <replaceable>outputfile
  97. </replaceable></term><listitem><para>Concatenates the resulting header or
  98. source files for all the classes listed on the command line into <replaceable>
  99. outputfile</replaceable>. Only the <option>o</option> or <option>d</option>
  100. option may be used.</para>
  101. </listitem></varlistentry>
  102. <varlistentry><term remap="15"><option>old</option></term><listitem><para>
  103. Specifies the old JDK1.0-style header files should be generated.</para>
  104. </listitem></varlistentry>
  105. <varlistentry><term remap="15"><option>stubs</option></term><listitem><para>
  106. Causes <command>javah</command> to generate C declarations from the Java object
  107. file. Only the <option>o</option> or <option>d</option> option may be used.
  108. </para>
  109. </listitem></varlistentry>
  110. <varlistentry><term remap="15"><option>trace</option></term><listitem><para>
  111. Tracing is no longer supported. Instead, use the <literal>–verbose:jni
  112. </literal> option of the virtual machine.</para>
  113. </listitem></varlistentry>
  114. <varlistentry><term remap="15"><option>verbose</option></term><listitem><para>
  115. Indicates verbose output and causes <command>javah</command> to print a message
  116. to <literal>stdout</literal> concerning the status of the generated files.
  117. </para>
  118. </listitem></varlistentry>
  119. <varlistentry><term remap="15"><option>version</option></term><listitem><para>
  120. Prints build version.</para>
  121. </listitem></varlistentry>
  122. <varlistentry><term><option role="nodash">J</option><replaceable>option</replaceable></term>
  123. <listitem><para>Pass <replaceable>option</replaceable> to the Java virtual
  124. machine, where option is one of the options described on the man page for
  125. the java application launcher, java (1). For example, <literal>-J-Xms48m</literal>
  126. sets the startup memory to 48 megabytes. It is a common convention for <literal>
  127. -J</literal> to pass options to the underlying virtual machine.</para>
  128. </listitem></varlistentry><?Pub Caret>
  129. </variablelist></refsect1>
  130. <refsect1><title>&envr-tt;</title>
  131. <variablelist termlength="narrow">
  132. <varlistentry><term remap="15"><envar>CLASSPATH</envar> </term><listitem>
  133. <para>Used to provide the system with a path to user-defined classes. Directories
  134. are separated by colons, for example, <informalexample><para><literal>.:/home/avh/classes:/usr/local/java/classes
  135. </literal> </para>
  136. </informalexample></para>
  137. </listitem></varlistentry>
  138. </variablelist></refsect1>
  139. <refsect1><title>&attr-tt;</title>
  140. <para>See <olink targetdocent="REFMAN5" localinfo="attributes-5"><citerefentry>
  141. <refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>
  142. for a description of the following attributes:</para>
  143. <informaltable frame="all" orient="port">
  144. <tgroup cols="2" colsep="1" rowsep="1"><colspec colnum="1" colname="col1"
  145. colwidth="1*" colsep="1" align="left"><colspec colnum="2" colname="col2" colwidth="1*"
  146. align="left">
  147. <thead>
  148. <row><entry colname="col1" rowsep="1" align="center" valign="top">ATTRIBUTE
  149. TYPE</entry><entry colname="col2" rowsep="1" align="center" valign="top">
  150. ATTRIBUTE VALUE</entry></row>
  151. </thead>
  152. <tbody>
  153. <row><entry>Availability</entry><entry>SUNWj3dev</entry></row>
  154. </tbody>
  155. </tgroup>
  156. </informaltable>
  157. </refsect1>
  158. <refsect1><title>&also-tt;</title>
  159. <para><citerefentry><refentrytitle>java</refentrytitle><manvolnum>1</manvolnum>
  160. </citerefentry>, <citerefentry><refentrytitle>javac</refentrytitle><manvolnum>
  161. 1</manvolnum></citerefentry>, <citerefentry><refentrytitle>javadoc</refentrytitle>
  162. <manvolnum>1</manvolnum></citerefentry>, <link linkend="javap-1"><citerefentry>
  163. <refentrytitle>javap</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>, <citerefentry>
  164. <refentrytitle>jdb</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry>
  165. <refentrytitle>attributes</refentrytitle><manvolnum>5</manvolnum></citerefentry> 
  166. </para>
  167. </refsect1>
  168. <!--+ 07/27/00 08:34:19
  169.     | tagMorph:  $Id: tagMorph-engine 1.54 1998/01/19 05:44:48 $
  170.     | tagMorph library:  $Id: libtagMorph.a 1.50 1998/01/19 22:02:51 $
  171.     | sunman-to-solbook 1.17
  172.     +-->
  173. </refentry>
  174. <?Pub *0000008966>
  175.