I can not get these two disadvantages of using JNI. I want to know more about them:
Difficult to debug runtime error in native code
Errors i
I'm not sure if this helps, but I used a native method to set a static flag in my JNI/C code to turn debug tracing on or off (default is off). Then I used good old printf() calls at the start of each JNI function that only executed if the flag was set. It's crude but it works.
It's also a good idea to provide some kind of version checking between the Java class and its JNI functions. This can be done with a JNI function that gets called from a static class initializer block. If the client has the wrong combination of libraries (i.e., the jarfile got updated but the JNI shared library didn't, or vice versa), you can throw an exception at class load time.