Step By Step |
Remember in Step 1: Write the Java Code you used the following method call to load a shared library namedhello
into your program at runtime:Now you are ready to create the shared library.System.loadLibrary("hello");In the previous two steps you create two native language files: in Step 4: Create a Stubs File you created a stubs file named
HelloWorld.c
, and in Step 5: Write the Native Method Implementation you wrote the implementation for thedisplayHelloWorld()
native method and saved it inHelloWorldImp.c
. You compile these two files into a library namedhello
to create it.Use whatever tools you have to compile the native language code that you created in the previous two steps into a shared library. On Solaris and MacOS, you'll create a shared library, on Windows 95/Nt you'll create a dynamically loadable library (DLL).
Step By Step |