Purpose and Features
JNI enables one to write native methods to handle situations when an application cannot be written entirely in the Java programming language, e.g. when the standard Java class library does not support the platform-specific features or program library. It is also used to modify an existing application—written in another programming language—to be accessible to Java applications. Many of the standard library classes depend on JNI to provide functionality to the developer and the user, e.g. file I/O and sound capabilities. Including performance- and platform-sensitive API implementations in the standard library allows all Java applications to access this functionality in a safe and platform-independent manner.
The JNI framework lets a native method use Java objects in the same way that Java code uses these objects. A native method can create Java objects and then inspect and use these objects to perform its tasks. A native method can also inspect and use objects created by Java application code.
JNI is sometimes referred to as the "escape hatch" for Java developers because it enables them to add functionality to their Java application that the standard Java APIs cannot otherwise provide. It can be used to interface with code written in other languages, such as C and C++. It is also used for time-critical calculations or operations like solving complicated mathematical equations, because native code may be faster than JVM code.
Read more about this topic: Java Native Interface
Famous quotes containing the words purpose and, purpose and/or features:
“With the breakdown of the traditional institutions which convey values, more of the burdens and responsibility for transmitting values fall upon parental shoulders, and it is getting harder all the time both to embody the virtues we hope to teach our children and to find for ourselves the ideals and values that will give our own lives purpose and direction.”
—Neil Kurshan (20th century)
“With the breakdown of the traditional institutions which convey values, more of the burdens and responsibility for transmitting values fall upon parental shoulders, and it is getting harder all the time both to embody the virtues we hope to teach our children and to find for ourselves the ideals and values that will give our own lives purpose and direction.”
—Neil Kurshan (20th century)
“It is a tribute to the peculiar horror of contemporary life that it makes the worst features of earlier timesthe stupefaction of the masses, the obsessed and driven lives of the bourgeoisieseem attractive by comparison.”
—Christopher Lasch (b. 1932)