Java(tm) Native Interface : Programmer's Guide and Specification (Paperback)

by Sheng Liang

Membership Type Price
Retail Price: $49.49
Online Price: $49.49
Club Price: $44.54
(Save 10%)
Join Now!

In stock. Usually ships within 24 hours.

Overview

Based on the extremely popular JNI tutorial on Sun's website, this book is a complete tutorial, programming guide, and reference for JNI, the interface which facilitates the integration of Java with existing C and C++ code.

ALSO AVAILABLE

Used Book Partners offer 18 copies

Related Categories:
Books > Computers & Internet > Programming Languages - Java

 

8 Ratings

  • ISBN-13: 9780201325775
  • ISBN-10: 0201325772
  • Publisher: Addison-Wesley Professional
  • Date: June 1999
  • Page Count: 320

Customer Reviews

Table of Contents

I. INTRODUCTION AND TUTORIAL.

1. Introduction.
The Java Platform and Host Environment. Role of the JNI. Implications of Using the JNI. When to Use the JNI. Evolution of the JNI. Example Programs.

2. Getting Started.
Overview. Declare the Native Method. Compile the HelloWorld Class. Create the Native Method Header File. Write the Native Method Implementation. Compile the C Source and Create a Native Library. Run the Program.

II. PROGRAMMER'S GUIDE.

3. Basic Types, Strings, and Arrays.
A Simple Native Method. Accessing Strings. Accessing Arrays.

4. Fields and Methods.
Accessing Fields. Calling Methods. Invoking Constructors. Caching Field and Method Ids. Performance of JNI Field and Method Operations.

5. Local and Global References.
Local and Global References. Freeing References. Rules for Managing References.

6. Exceptions.
Overview. Proper Exception Handling.

7. The Invocation Interface.
Creating the Java Virtual Machine. Linking Native Applications with the Java Virtual Machine. Attaching Native Threads.

8. Additional JNI Features.
JNI and Threads. Writing Internationalized Code. Registering Native Methods. Load and Unload Handlers. Reflection Support. JNI Programming in C++.

9. Leveraging Existing Native Libraries.
One-to-One Mapping. Shared Stubs. One-to-One Mapping versus Shared Stubs. Implementation of Shared Stubs. Peer Classes.

10. Traps and Pitfalls.
Error Checking. Passing Invalid Arguments to JNI Functions. Confusing jclass with jobject. Truncating jboolean Arguments. Boundaries between Java Application and Native Code. Confusing IDs with References. Caching Field and Method Ids. Terminating Unicode Strings. Violating Access Control Rules. Disregarding Internationalization. Retaining Virtual Machine Resources. Excessive Local Reference Creation. Using Invalid Local References. Using the JNIEnv across Threads. Mismatched Thread Models.

III. SPECIFICATION.

11. Overview of the JNI Design.
Design Goals. Loading Native Libraries. Linking Native Methods. Calling Conventions. The JNIEnv Interface Pointer. Passing Data. Accessing Objects. Errors and Exceptions.

12. JNI Types.
Primitive and Reference Types. Field and Method Ids. String Formats. Constants.

13. JNI Functions.
Summary of the JNI Functions. Specification of JNI Functions.

Index. 0201325772T04062001

 

8 Ratings

  • ISBN: 9780201325775
  • Publisher: Addison-Wesley Professional
  • Date: June 1999
  • Page Count: 320
  • Availability: In stock. Usually ships within 24 hours.