modiy C func to JNI function