This is a sample example of how to call out to a C shared library from Java.
I have only built this on OS X but it's pretty simple and you could get it running on your *nix easily.
Dependencies: JDK, gcc, make
To build and run:
make
To clean it up:
make clean