merge jni code