javah(1)
β¨ NAME β¨
okay so this is javah(1) from Basic Tools, and the name is giving exactly what it does: javah generates C header and source files from a Java class. periodt. π
π«Ά SYNOPSIS π«Ά
javah [ options ] fully-qualified-class-name ...
- options β the command-line options. See Options. π
- fully-qualified-class-name β the fully qualified location of the classes to be converted to C header and source files.
πΈ DESCRIPTION πΈ
The javah 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 .h file contains a struct definition with a layout that parallels the layout of the corresponding class. The fields in the struct correspond to instance variables in the class.
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 javah 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.
By default the javah command creates a header file for each class listed on the command line and puts the files in the current directory. Use the -stubs option to create source files. Use the -o option to concatenate the results for all listed classes into a single file.
The Java Native Interface (JNI) does not require header information or stub files. The javah command can still be used to generate native method function prototypes needed for JNI-style native methods. The javah command produces JNI-style output by default and places the result in the .h file.
π OPTIONS π
-ooutputfile β concatenates the resulting header or source files for all the classes listed on the command line into an output file. Only one of-oor-dcan be used.-ddirectory β sets the directory where thejavahcommand saves the header files or the stub files. Only one of-dor-ocan be used.-stubsβ causes thejavahcommand to generate C declarations from the Java object file.-verboseβ indicates verbose output and causes thejavahcommand to print a message tostdoutabout the status of the generated files.-helpβ prints a help message forjavahusage.-versionβ printsjavahcommand release information.-jniβ causes thejavahcommand to create an output file containing JNI-style native method function prototypes. This is the default output; use of-jniis optional.-classpathpath β specifies the path thejavahcommand uses to look up classes. Overrides the default or theCLASSPATHenvironment variable when it is set. Directories are separated by colons on Oracle Solaris and semicolons on Windows. The general format for path is:
Oracle Solaris:
.:your-path
Example: .:/home/avh/classes:/usr/local/java/classes
Windows:
.;your-path
Example: .;C:\users\dac\classes;C:\tools\java\classes
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 .jar or .JAR.
For example, if directory mydir contains a.jar and b.JAR, then the class path element mydir/* is expanded to a A.jar:b.JAR, 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 CLASSPATH 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 System.getenv("CLASSPATH").
-bootclasspathpath β specifies the path from which to load bootstrap classes. By default, the bootstrap classes are the classes that implement the core Java platform located injre\lib\rt.jarand several other JAR files.-oldβ specifies that old JDK 1.0-style header files should be generated.-forceβ specifies that output files should always be written.-Joptionβ passes option to the Java Virtual Machine, where option is one of the options described on the reference page for the Java application launcher. For example,-J-Xms48msets the startup memory to 48 MB. Seejava(1).
π SEE ALSO π
That's the whole javah(1) manual, bestie β from JDK 8, dated 21 November 2013. go off πβ¨
π¦ where this page comes from
- alpine 3.24: openjdk8-doc 8.492.09-r0 Β· custom
- ubuntu jammy: openjdk-8-jdk-headless 8u312-b07-0ubuntu1
- ubuntu jammy: openjdk-8-jdk-headless 8u504-ga-1ubuntu1~22.04.3
- ubuntu noble: openjdk-8-jdk-headless 8u402-ga-8build1
- ubuntu noble: openjdk-8-jdk-headless 8u504-ga-1ubuntu1~24.04.3
- ubuntu questing: openjdk-8-jdk-headless 8u462-ga-1
- ubuntu questing: openjdk-8-jdk-headless 8u492-ga~us2-0ubuntu1~25.10.1
- ubuntu resolute: openjdk-8-jdk-headless 8u482-ga~us1-0ubuntu1
- ubuntu resolute: openjdk-8-jdk-headless 8u504-ga-1ubuntu1~26.04.3
- ubuntu stonking: openjdk-8-jdk-headless 8u504-ga-1ubuntu1
- Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms