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 about JNI, but if you're using JNA, you can set Native.setProtected(true) and it will throw an error instead of crashing the JVM, so that you can catch it in try...catch block. So second disadvantage is not a problem. (see source code)
Native.setProtected(true)