Fix the error of JNI. Now it can run correctly everytimes.