Disadvantages of using Java Native Interface
•
Java
I can't get two disadvantages of using JNI I want to know more about them:
>It is difficult to debug runtime errors. Errors in local code > JNI code occupy the entire JVM and do not provide any mechanism to optimize recovery
Solution
Difficult to debug
>You need a C / C + + debugger to debug native code It is impossible to easily from Java to C / C + + code (although I can debug twice at the same time, I have finished debugging with eclipse and CDT plug-ins, but it is painful)
Errors in JNI
>Bad C / C + + code in the native library may cause core dump / segmentation errors that the JVM cannot recover, so your entire application crashes
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码