Overview
Leverage platform-specific features without compromising binary compatibility!
With the Java Native Interface API, you get the best of both worlds: access to the native platform features you need to get the job done plus full binary compatibility across multiple Java Virtual Machines. And there is no better way to master the JNI than this fast-paced, example-rich guide, which focuses on proven techniques.
Walk step-by-step through writing Java and native code components, building libraries, loading and invoking native methods, and more. Discover powerful techniques for creating Java Virtual Machines from within any native application. Learn proven approaches to integrating Java and C++ code, converting C structures, and providing serial I/O from Java on both POSIX and Win32 platforms. Get comprehensive debugging help. There's even a complete, easy-to-use API reference!
With JNI, you can leverage Java's extraordinary capabilities without sacrificing proven legacy code.
Essential JNI: Java Native Interface gives you the insight, proven techniques, and real-world sample code you'll need to get results with JNI, plus:
- A complete, task-oriented reference to the entire Java Native Interface API
- Tools and strategies for integrating legacy code with new Java applications
- Extensive code examples and detailed debugging tips
- Clear explanations of JNI native types, signatures, references, and object and class functions
- Specific techniques for managing C++ code and converting C structures
Aimed at software engineers and Java programmers, this book teaches Java and C/C++ integration. With an introduction to the Java Native Interface (JNI) API, the authors cover the entire API for the JNI, including the enhancements introduced in release 1.2 of JDK. JNI helps users access native platform features and full binary compatibility across multiple Java Virtual Machines (JVM).
Editorials
From Barnes & Noble
Fatbrain Review
Aimed at software engineers and Java programmers, this book teaches Java and C/C++ integration. With an introduction to the Java Native Interface (JNI) API, the authors cover the entire API for the JNI, including the enhancements introduced in release 1.2 of JDK. JNI helps users access native platform features and full binary compatibility across multiple Java Virtual Machines (JVM).The first section gives detailed coverage of JNI API, with a JNI version of "Hello World," Java variables and Java types. It also includes by explaining the remaining JNI functions, including objects, arrays, exceptions and monitors. The second section explains how to use JNI to integrate Java code with non-Java code. Chapters 9 through 11 discuss Java and C++, C structure conversions and native serial I/O. Chapters 12 and 13 tackle the Invocation API, providing details on how to start a Java Virtual Machine mechanisms from a C/C++ application. They also discuss starting the JVM as an NT service.
Chapter 14 concentrates on debugging Java applications with native code. The final chapter is devoted to changes and enhancements to JNI in the SDK 1.2. The appendices contain JNI references, 1.0 native methods versus JNI and StructConverter references. This is followed by a JAVAH reference and a brief discussion of native methods, applets and security issues.