diff --git a/java/jni/com_zerotierone_sdk_Node.cpp b/java/jni/com_zerotierone_sdk_Node.cpp index 36d722c7d..260e523cf 100644 --- a/java/jni/com_zerotierone_sdk_Node.cpp +++ b/java/jni/com_zerotierone_sdk_Node.cpp @@ -194,7 +194,13 @@ namespace { assert(ref); assert(ref->node == node); JNIEnv *env; - GETENV(env, ref->jvm); + + jint getEnvRet; + assert(ref->jvm); + if ((getEnvRet = ref->jvm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6)) != JNI_OK) { + LOGE("Error calling GetEnv: %d", getEnvRet); + assert(false && "Error calling GetEnv"); + } if (env->ExceptionCheck()) { LOGE("Unhandled pending exception");