The Java Native Interface is just that: an interface. More specifically, it is a Java API that programmers can write to, instead of writing directly to a vendor-specific virtual machine API. This has the benefit that programmers need only implement one version of their software, rather than a version for each specific VM. Also, since the JNI is part of the Java API, all implementations of the Java VM are guaranteed to support it.
The JNI supports two paradigms or models. The first model allows Java code to access native code that resides in a shared library. This portion of the JNI doesn't have an official name, so we'll just refer to it as the JNI proper. The second model allows a native application to access Java code. This second model is known as the Invocation API and using it within a native application or shared library is known as embedding the Java virtual machine.
These documents were originally written before Kylix, so naturally they were Windows-only. However, most (if not all) of the material applies to Kylix and Linux as well. Rather than re-write a separate document for Kylix (which would be about 98% identical in content) or use the phrases "Delphi or Kylix" and "DLL or SO" everywhere, I've left it Windows-specific. I've tried to point out any differences between the two environments, but may have missed something along the way. When I say Delphi, I am referring to both Delphi and Kylix. When I say DLL, I am referring to both DLLs (.DLL) on Windows and shared libraries (.so) on Linux.
Part Two - Techniques and Examples After completing Part One, you can move on to more complex interactions between Java and Delphi code. This part demonstrates several techniques such as creating Java objects in Delphi, passing two-dimensional arrays, exceptions, etc.
Part Three - The Invocation API This portion of the JNI is what allows Delphi to call into Java code. It demonstrates a Delphi GUI application that calls Java code to download URLs over the Internet. It also shows how to create and use multiple Java objects in background threads.
If you are interested in programming with the Java Native Interface, do yourself a favor and get Sheng Liang's book. (He designed the JNI.) It is the Bible of JNI programming. The code is in C/C++ but translates to Delphi code almost one-to-one. There is a wealth of information on all aspects of using the Java Native Interface. You will save yourself from hours of frustration. Worth every penny.
The Java Native Interface: Programmer's Guide and Specification by Sheng Liang (Addison-Wesley Publishing Company, June 1999. ISBN 0201325772)