JNIEnv
JNIEnv is a pointer to a structure of function pointers that expose the Java Native Interface (JNI) for a thread calling into native code. In C and C++ native methods, the first parameter is typically JNIEnv* env, through which all JNI operations are performed. The env pointer represents the per-thread JNI environment and is valid only for the duration of the thread’s attachment to the Java Virtual Machine (VMI) or the duration of the native method call.
A native thread must attach to the JVM to obtain a JNIEnv*. If the native code is
JNIEnv provides access to functions for interacting with Java objects and classes, including FindClass, GetMethodID, GetFieldID,
In summary, JNIEnv is the thread-specific interface to JNI, enabling native code to interact with Java code