use proper thread-specific JNI env