Enter your mobile number below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
Getting the download link through email is temporarily not available. Please check back later.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your mobile phone number.

The Java Native Interface: Programmer's Guide and Specification (The Java Series) 1st Edition

3.8 out of 5 stars 17 customer reviews
ISBN-13: 078-5342325775
ISBN-10: 0201325772
Why is ISBN important?
ISBN
This bar-code number lets you verify that you're getting exactly the right version or edition of a book. The 13-digit and 10-digit formats both work.
Scan an ISBN with your phone
Use the Amazon App to scan ISBNs and compare prices.
Have one to sell? Sell on Amazon
Buy used On clicking this link, a new layer will be open
$5.48 On clicking this link, a new layer will be open
Buy new On clicking this link, a new layer will be open
$30.80 On clicking this link, a new layer will be open
More Buying Choices
27 New from $17.88 44 Used from $0.01 2 Collectible from $7.95
Free Two-Day Shipping for College Students with Prime Student Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student


Security
ITPro.TV Video Training
Take advantage of IT courses online anywhere, anytime with ITPro.TV. Learn more.
$30.80 FREE Shipping. Only 4 left in stock (more on the way). Ships from and sold by Amazon.com. Gift-wrap available.
click to open popover

Frequently Bought Together

  • The Java Native Interface: Programmer's Guide and Specification (The Java Series)
  • +
  • Professional Java Native Interfaces with SWT / JFace
Total price: $90.80
Buy the selected items together

Editorial Reviews

Amazon.com Review

Written for the experienced Java developer, The Java Native Interface documents the latest in native code programming for the Java platform using the Java Native Interface (JNI) with C/C++. Author Sheng Liang built the book around "dos and don'ts," even specifying within the introduction when you should and when you should not use JNI. Though sometimes densely written, this title certainly conveys a good deal of technical information on using native code with Java.

After a simple JNI "Hello World" code example, this book explores multiple aspects of the JNI API, starting with the use of Java strings and arrays within native code. Liang follows by transitioning into calling Java members and methods in C/C++. Here the author presents caching strategies for improving the performance of native code that interacts with or executes Java programs, including a discussion of local and global references that incorporates global weak references in Java 2.

The book also looks at handling exceptions within C/C++ code, as well as tips for working with Java threads. The author shows how to simplify access to C/C++ code through shared stubs and how to use peer classes to encapsulate native code from within Java. A section on common traps and pitfalls lists some common pitfalls to avoid when working with the JNI. After presenting the JNI specification, the author provides the most immediately useful text in the book--over 100 pages of reference material listing JNI data types and methods.

As a reference and programming guide, The Java Native Interface provides concise and timely technical details on getting Java and C/C++ code to coexist within your projects. --Richard Dragan

From the Back Cover

The Java Native Interface (JNI) enables the integration of code written in the Java programming language with code written in other languages such as C and C++. It allows programmers to take full advantage of the Java platform without having to abandon their investment in legacy code.

This book is the definitive resource and a comprehensive guide to working with the JNI. Entirely up-to-date, the book offers a tutorial, a detailed description of JNI features and programming techniques, JNI design justifications, and the official specification for all JNI types and functions.

You will find coverage of important topics such as:

  • Writing native methods
  • Passing data types between the Java language and native programming languages
  • Embedding a Java virtual machine implementation in native applications
  • Leveraging legacy native libraries
  • Improving the efficiency and reliability of your code

An entire chapter is devoted to avoiding common traps and pitfalls. The book uses numerous examples to illustrate programming techniques that have proven to be effective.



0201325772B04062001
NO_CONTENT_IN_FEATURE

New York Times best sellers
Browse the New York Times best sellers in popular categories like Fiction, Nonfiction, Picture Books and more. See more

Product Details

  • Paperback: 320 pages
  • Publisher: Addison-Wesley Professional; 1 edition (June 20, 1999)
  • Language: English
  • ISBN-10: 0201325772
  • ISBN-13: 978-0201325775
  • Product Dimensions: 7.2 x 0.7 x 9 inches
  • Shipping Weight: 1.4 pounds (View shipping rates and policies)
  • Average Customer Review: 3.8 out of 5 stars  See all reviews (17 customer reviews)
  • Amazon Best Sellers Rank: #1,217,265 in Books (See Top 100 in Books)

Customer Reviews

Top Customer Reviews

Format: Paperback
This is book is very handy if you are programming for JNI. I went and bought this book but later found that is free on the Sun's Java site.... So buy it only if you need a paper copy. If you are ok with a PDF or html copy goto sun's website to get it.
Comment 34 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
I had to integrate our company's distributed Java component-based application with a vendor's C/C++ - only libraries. My C++ skills had gotten pretty rusty and so I bought the Gordon JNI book and was really disappointed.
I then bought this book and was much happier with its examples and approach than the Gordon book. While the other reviewers in this page cited that they thought the book was bad or the examples didn't compile, they may be justified, but since they have only to choose from this and the Gordon book on JNI, I think they will find this book is far clearer and more concise.
What's more is that it's terse enough that you can get the whole book read during the course of a 3 week project.
And as far as the author having a bias towards Java is concerned: Duh.
Comment 22 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This is an excellent book! Liang provides short, illustrative, and useful examples as well as helpful tips for the JNI user. The presentation is extremely clear, with no fluff. This book is more informative than any existing material on JNI I know of. It offers a gentle introduction for the novice as well as technical depth for the expert. I particularly like the level of insight that only the designer and architect of the JNI can provide. My favorite programming technique is "shared stubs," beats J/Direct.
Comment 11 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
The reason I write this comment is that I was suprised
that this book is available in electronic form, free
of charge from Sun website.
As far as I read the book, it is quite good but I did not
test anything. I probably will in my summer project and I will
inform you if what the Native Interface promised , did
finally work.
Anyway the Sun website for the book is :
[website]
Comment 16 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
The problem with JNI is that there are no to many books. When you start using JNI it looks complex. After a while you realized is simple. This book help me to understand and use JNI. Now after a year of using it I decided to write this review. This book is the best out there for JNI. Sure it could have more examples and longer explanations. Every paragraph in this book is important. The author is very concise but cover the whole subject. In the back you get a reference to the JNI API. I look at the other books (2) and I am very happy I bought this book.
Comment 6 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
...and I'd pay $40 (or whatever) for chapter 10 by itself. Wondering why getStringChars() returns a pointer to a char[] with some gibberish at the end? Check out section 10.8. Trying to figure out why you're getting strange warnings about too many local references? Read section 10.12.
That's just a taste. Not only does Liang discuss caching method & field IDs, he spends about 10 pages at the end of chapter 4 detailing two strategies for doing it. Then he describes the performance differences btwn Java inter-object method calls, Java-native calls, and native-Java calls. What a gold mine.
Yeah, there are some typos in the examples. Yeah, it's biased against native code - and why not, when it take 10 lines of tedious, error prone C to replace 1 line of Java? But if you are a JNI programmer, this has got to be on your desk.
Comment 4 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
This is one of the best Java programming books around. Not only are all the major issues surrounding JNI programming addressed, but the author also presents a great disussion on the organization of JNI.
My only complaint is that embedding JNI in native apps is barely touched. However, this is a complicated subject, and the information shared is enough to get started.
This book is definitely required reading for those interested in bringing legacy code into a Java framework. Also, its a good read, and a great example of nonfiction writing.
Comment 3 people found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse
Format: Paperback
While I have enjoyed many of Sun's books, this one is simply inadequate. The organization of topics was mediocre, but, in my opinion, the book is a disappointment because of its sheer lack of depth (just 300 pages). What few examples that were provided are typically discussed in two or three sentence paragraphs, often leaving out several key concepts contained in the example. In addition, many more subtle patterns/topics seem to be left as an excerise for the reader. Unfortunately, this probably _is_ the most complete JNI book to date.
Comment One person found this helpful. Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again
Report abuse

Set up an Amazon Giveaway

The Java Native Interface: Programmer's Guide and Specification (The Java Series)
Amazon Giveaway allows you to run promotional giveaways in order to create buzz, reward your audience, and attract new followers and customers. Learn more about Amazon Giveaway
This item: The Java Native Interface: Programmer's Guide and Specification (The Java Series)

What Other Items Do Customers Buy After Viewing This Item?