3.3. Java Native Interface
A distinction is made between programs compiled for the virtual machine and
programs compiled to run on a speci c computation platform, like Intel x86 or
ARM. Programs compiled for a speci c platform are called native. Because Java
is executed in a virtual machine with its own byte-code, no native code can be
executed directly. Due to the need to access low-level os mechanism like kernel
calls, Java has to overcome this obstacle. This is done by the Java native interface
(JNI) [22], which allows Java to execute compiled code from libraries written in
other languages, e.g. C++. This is a trade-o between gaining capabilities of
accessing the system and decreasing the level of security in Java.
A distinction is made between programs compiled for the virtual machine and
programs compiled to run on a speci c computation platform, like Intel x86 or
ARM. Programs compiled for a speci c platform are called native. Because Java
is executed in a virtual machine with its own byte-code, no native code can be
executed directly. Due to the need to access low-level os mechanism like kernel
calls, Java has to overcome this obstacle. This is done by the Java native interface
(JNI) [22], which allows Java to execute compiled code from libraries written in
other languages, e.g. C++. This is a trade-o between gaining capabilities of
accessing the system and decreasing the level of security in Java.
本文讨论了Java虚拟机与特定计算平台(如Intel x86或ARM)之间的程序区别,解释了如何通过Java Native Interface (JNI)允许Java执行从其他语言(如C++)编写的库中编译的代码,这一过程在获得系统访问能力的同时牺牲了安全性。
172

被折叠的 条评论
为什么被折叠?



