fix compatibility for both of JNI enabled and not
fix compatibility for both of JNI enabled and not