Using biometrics sensor

I am using a biometrics reader to access users in the system. I had to compile a library in C to be able to communicate with the reader through JNI, but it is giving a lot of memory error and crash in the jvm.

Any suggestions for another option to communicate with the reader other than through JNI?

Thank you.