IBM User Guide for Java V7 on Windows > IBM SDK for Java
The Java Native Interface (JNI)
This description of the Java™ Native Interface (JNI) provides background information to help you diagnose problems with JNI operation.
The specification for the Java Native Interface (JNI) is maintained by Oracle Corporation. IBM recommends that you read the JNI specification. Go to http://www.oracle.com/technetwork/java/index.html and search the site for JNI. Oracle Corporation maintain a combined programming guide and specification at http://java.sun.com/docs/books/jni/.
This section gives additional information to help you with JNI operation and design.
- Overview of JNI
From the viewpoint of a JVM, there are two types of code: "Java" and "native". The Java Native Interface (JNI) establishes a well-defined and platform-independent interface between the two.- The JNI and the Garbage Collector
This description explains how the JNI implementation ensures that objects can be reached by the Garbage Collector (GC).- Copying and pinning
The GC might, at any time, decide it needs to compact the garbage-collected heap. Compaction involves physically moving objects from one address to another. These objects might be referred to by a JNI local or global reference. To allow compaction to occur safely, JNI references are not direct pointers to the heap. At least one level of indirection isolates the native code from object movement.- Handling exceptions
Exceptions give you a way to handle errors in your application. Java has a clear and consistent strategy for the handling of exceptions, but C/C++ code does not. Therefore, the Java JNI does not throw an exception when it detects a fault. The JNI does not know how, or even if, the native code of an application can handle it.- Synchronization
When you get array elements through a Get<Type>ArrayElements call, you must think about synchronization.- Debugging the JNI
If you think you have a JNI problem, there are checks you can run to help you diagnose the JNI transitions.- JNI checklist
There are a number of items that you must remember when using the JNI.
Parent: IBM SDK for Java
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.