Chapter 7. The Invocation Interface
This chapter illustrates how you can embed a Java virtual machine in your native application. A Java virtual machine implementation is typically shipped as a native library. Native applications can link against this library and use the invocation interface to load the Java virtual machine. Indeed, the standard launcher command (
java) in JDK or Java 2 SDK releases is no more than a simple C program linked with the Java virtual machine. The launcher parses the command line arguments, loads the virtual machine, and runs Java applications through the invocation interface.
Creating the Java Virtual Machine
To illustrate the invocation interface, let’s look at a C program that loads a Java virtual machine and calls ...