The goal of this mini-project is to illustrate the usage of the Java Native Interface (JNI). A Makefile is used to compile the project so that every details about the building phases are exposed:
- Compilation of the
libexample.solibrary - Compilation of the
JNIExamplejava class - Generation of the header containing native methods from the
JNIExampleclass - Compilation of the native methods binding the function exposed in libexample to the Java language
This project as been tested on GNU/Linux but it should be usable without modification on any POSIX system where a C compiler, GNU Make and a Java SDK are installed.
Compile with make, run with make run.
- Ensure you have a working C compiler.
- Ensure the various binaries distributed with the Java SDK are in your PATH.
- Set
JAVA_HOMEto the locatation of the Java SDK.