Introducing JNI

The Java Native Interface (JNI) allows you to write Java programs that utilize code written in programming languages other than Java. There are several scenarios where it is preferable or necessary to use non-Java code:

  • When you require functionality not supported by the standard Java class library. For example, you may need to access parts of the Win32 API.

  • When you want to reuse a library or application already written in another programming language. For example, many organizations possess large legacy C libraries.

  • When you want to use features or capabilities of another programming language not readily available in Java.

JNI allows you to write code that supports these scenarios. You can use JNI to declare native methods, and ...

Get Sams Teach Yourself J2EE™ in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.