Essential JNI: Java Native Interface

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 ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (18) from $1.99   
  • New (1) from $50.00   
  • Used (17) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$50.00
Seller since 2014

Feedback rating:

(139)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

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).

Read More Show Less

Editorial Reviews

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.

Read More Show Less

Product Details

  • ISBN-13: 9780136798958
  • Publisher: Prentice Hall Professional Technical Reference
  • Publication date: 3/4/1998
  • Series: Essential Series for Web Professionals
  • Edition number: 1
  • Pages: 528
  • Product dimensions: 6.10 (w) x 8.97 (h) x 0.93 (d)

Meet the Author


Rob Gordon is a software consultant who has worked for Motorola, convex Computers, and, most recently, Sun Microsystems. He has extensive experience both as a Java software developer and as a developer of educational materials on operating systems, device drivers, and programming languages.
Read More Show Less

Read an Excerpt

PREFACE:

Before we plow an unfamiliar patch It is well to be informed about the winds, About the variations in the sky, The native traits and habits of the place, What each locale permits, and what denies Virgil The Georgics

Preface

What This Book is About
The subject of this book is the Java Native Interface (JNI) Application Programming Interface (API). The JNI was introduced in release 1.1 of the Java Development Kit (JDK) as distributed by JavaSoft. This book covers the entire API for the JNI including the enhancements introduced in release 1.2 of the JDK. Where there are minor differences between various 1.1 point releases, these are discussed.

Who Should Read This Book?
This book is written for the software engineer who needs to make Java and C or C++ talk to one another. Experience with C/C++ and Java is assumed. This book also assumes some familiarity with both UNIX and Win32 platforms.

If you are a Java programmer who needs to step outside the Java Virtual Machine to take advantage of some platform-specific functionality, this book will show you how. If you are a C programmer responsible for putting a Java font-end on a legacy application, this book will show you how. If you are a C++ programmer wanting to take advantage of an existing C++ class library, this book will show you how.

Further, this book covers these topics for both UNIX and Win32 platforms.
Okay, now turn around and walk to the sales counter.

Structure of This Book

This book can be thought of as having three distinct parts. The first part, roughly the first eight chapters, covers the JNI API in great detail. Thesecond part, the remaining chapters, covers some general issues involved with native method programming. The third part, a series of appendices, contains reference material, both for the JNI and for tools introduced in this book. There is also an appendix that compares the JNI with the old-style native method programming model introduced in JDK 1.0. The last appendix offers a brief discussion of native methods, applets and security issues.

The early chapters contain plenty of simple examples intended to highlight the essential features of the API. No attempt is made to place JNI function calls into large, complex examples that obscure their salient features.

The first part of the book takes a walk-before-you-run approach. After an overview of the JNI in Chapter 1.
Chapter 2 presents a JNI version of the classic "Hello World" example.
Chapter 3 then follows with examples of some of the more common JNI operations before plunging into the syntactical details of the JNI in Chapter 4.
With all that work behind you, Chapter 5 through Chapter 8 provides detailed coverage of the remaining JNI functions.

The second half of the book deals with a series of general topics on using the JNI to integrate Java code with non-Java code. Chapter 9 presents an approach for mirroring existing C++ classes in Java. Chapter 10 introduces a tool for the automatic conversion of C structures into Java classes and an accompanying set of adapter functions for copying data between an instance of a C structure and a Java object. Chapter 11 starts with a collection of Java classes that provide a high-level interface to serial and parallel ports. Throughout this chapter the native code for targetting these classes for both POSIX and Win32 platforms is presented and discussed. The Java package used in this chapter is the portio package which is freely-available from Central Data (www.cd.com) as well as being included with the examples at the Prentice-Hall ftp site.

Chapter 12 and Chapter 13 deal with the Invocation API. Chapter 12 is a broad discussion of the mechanics involved with starting a Java Virtual Machine from a C/C++ application. Chapter 13 provides a very specific example of this facility, namely, starting the Java Virtual Machine (JVM) as an NT service. This chapter is for NT developers who wish to use Sun's JVM as an engine for their Java applications. Chapter 14 presents some approaches to debugging a Java application that includes native code. Finally, Chapter 15 is dedicated to changes and enhancements to the JNI in the JDK 1.2.

Whose Java?
This book covers the Java Native Interface API. To use the Java Native Interface API, you will need to run your Java code on a Java Virtual Machine that supports the JNI. The list of JVM vendors supporting the JNI is growing, but a sure bet is the JVM distributed by Sun. The Sun JVM, the Java Core classes and the JNI are available as part of the Java Development Kit (JDK). The JNI is supported starting in release 1.1 of the JDK.

To download the JDK, surf to the JavaSoft download site: ...
Read More Show Less

Table of Contents

Preface
Acknowledgments
Ch. 1 Why JNI? 1
Ch. 2 Hello JNI World 7
Ch. 3 Setting Java Variables, Invoking Java Methods 25
Ch. 4 Native Types, Signatures and Other Details 49
Ch. 5 Objects and Classes 65
Ch. 6 Arrays and Strings 95
Ch. 7 Exceptions 121
Ch. 8 Monitors 135
Ch. 9 Java and C++ 151
Ch. 10 Conversion of C Structures 185
Ch. 11 Native Serial I/O 213
Ch. 12 Running the JVM From a C/C++ Application 249
Ch. 13 An NT Service Application 291
Ch. 14 Debugging Native Methods 317
Ch. 15 JDK 1.2 Enhancements to JNI 331
App. A JNI Reference 341
App. B 1.0 Native Methods vs. JNI 441
App. C StructConverter Reference 463
App. D JAVAH Reference 471
App. E Native Methods, Applets, Security 475
Index 485
Credits 499
Read More Show Less

Preface

PREFACE:

Before we plow an unfamiliar patch It is well to be informed about the winds, About the variations in the sky, The native traits and habits of the place, What each locale permits, and what denies Virgil The Georgics

Preface

What This Book is About
The subject of this book is the Java Native Interface (JNI) Application Programming Interface (API). The JNI was introduced in release 1.1 of the Java Development Kit (JDK) as distributed by JavaSoft. This book covers the entire API for the JNI including the enhancements introduced in release 1.2 of the JDK. Where there are minor differences between various 1.1 point releases, these are discussed.

Who Should Read This Book?
This book is written for the software engineer who needs to make Java and C or C++ talk to one another. Experience with C/C++ and Java is assumed. This book also assumes some familiarity with both UNIX and Win32 platforms.

If you are a Java programmer who needs to step outside the Java Virtual Machine to take advantage of some platform-specific functionality, this book will show you how. If you are a C programmer responsible for putting a Java font-end on a legacy application, this book will show you how. If you are a C++ programmer wanting to take advantage of an existing C++ class library, this book will show you how.

Further, this book covers these topics for both UNIX and Win32 platforms.
Okay, now turn around and walk to the sales counter.

Structure of This Book

This book can be thought of as having three distinct parts. The first part, roughly the first eight chapters, covers the JNI API in great detail.Thesecond part, the remaining chapters, covers some general issues involved with native method programming. The third part, a series of appendices, contains reference material, both for the JNI and for tools introduced in this book. There is also an appendix that compares the JNI with the old-style native method programming model introduced in JDK 1.0. The last appendix offers a brief discussion of native methods, applets and security issues.

The early chapters contain plenty of simple examples intended to highlight the essential features of the API. No attempt is made to place JNI function calls into large, complex examples that obscure their salient features.

The first part of the book takes a walk-before-you-run approach. After an overview of the JNI in Chapter 1.
Chapter 2 presents a JNI version of the classic "Hello World" example.
Chapter 3 then follows with examples of some of the more common JNI operations before plunging into the syntactical details of the JNI in Chapter 4.
With all that work behind you, Chapter 5 through Chapter 8 provides detailed coverage of the remaining JNI functions.

The second half of the book deals with a series of general topics on using the JNI to integrate Java code with non-Java code. Chapter 9 presents an approach for mirroring existing C++ classes in Java. Chapter 10 introduces a tool for the automatic conversion of C structures into Java classes and an accompanying set of adapter functions for copying data between an instance of a C structure and a Java object. Chapter 11 starts with a collection of Java classes that provide a high-level interface to serial and parallel ports. Throughout this chapter the native code for targetting these classes for both POSIX and Win32 platforms is presented and discussed. The Java package used in this chapter is the portio package which is freely-available from Central Data (www.cd.com) as well as being included with the examples at the Prentice-Hall ftp site.

Chapter 12 and Chapter 13 deal with the Invocation API. Chapter 12 is a broad discussion of the mechanics involved with starting a Java Virtual Machine from a C/C++ application. Chapter 13 provides a very specific example of this facility, namely, starting the Java Virtual Machine (JVM) as an NT service. This chapter is for NT developers who wish to use Sun's JVM as an engine for their Java applications. Chapter 14 presents some approaches to debugging a Java application that includes native code. Finally, Chapter 15 is dedicated to changes and enhancements to the JNI in the JDK 1.2.

Whose Java?
This book covers the Java Native Interface API. To use the Java Native Interface API, you will need to run your Java code on a Java Virtual Machine that supports the JNI. The list of JVM vendors supporting the JNI is growing, but a sure bet is the JVM distributed by Sun. The Sun JVM, the Java Core classes and the JNI are available as part of the Java Development Kit (JDK). The JNI is supported starting in release 1.1 of the JDK.

To download the JDK, surf to the JavaSoft download site: ...
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)