摘要
文章研究Java程序与本机代码交互的机制,它通过在Java虚拟机(JVM)和本机代码之间提供一组接口来实现.JNI可用于访问本机库、函数和数据结构.通过具体实例的实现,验证了在保持Java平台无关性的同时又充分发挥了本地平台的优势.
Abstract
This article investigates the mechanism of interaction between Java programs and native code,which is achieved by providing a set of interfaces between the Java Virtual Machine(JVM)and native code.JNI can be used to access native libraries,functions,and data structures.Through the implementation of specific examples,it has been verified that the advantages of the local platform are fully utilized while maintaining Java platform independence.