|
|
Step By Step |
In addition to the.hfile that you generated in the previous step, you must also usejavahto generate a stub file. The stub file contains C code that provides the glue that holds the Java class and its parallel C structure together.To generate a stub file use
javah's-stubsoption. Again remember to runjavahon the Java class.By default,
javahwill place the resulting stub file in the same directory as the.classfile. You can use the-doption to forcejavahto put the generated stub file in a different directory.Similar to the
.hfile thatjavahgenerates, the name of the stubs file is the class name with.cappended to the end. In the "Hello World!" example that you've been working with throughout this lesson, the stub file is calledHelloWorld.c.For the moment, all you really need to know about the stub file is that you will later compile it into the dynamically loadable library that you create in Step 6: Create a Dynamically Loadable Library.
See Also
javah Man Page
Developer Tools
|
|
Step By Step |