You locate the method using its name and signature. The JNI allows you to locate the field using the field's name and type signature. This section teaches you how to deal with exceptions from within a native method implementation. Your native method can catch, throw, and clear exceptions. Local and Global References Native code can refer to Java objects using either local or global references.
Local references are only valid within a native method invocation.
They are freed automatically after the native method returns. You must explicitly allocate and free global references. This section describes the implications of running native methods in the multi-threaded Java environment. The JNI offers basic synchronization constructs for native methods. This section shows you how to load the Java Virtual Machine from a native library into a native application.