Covert jni to C++