Basic JNI thread setup