Create a class, say Test.java, that has fucntions to be imported embedded inside it.
Compile the class, and then run the autmatic C header generator
javac Test.java javah Test
You will get Test.class and Test.h
Create your implementation for external functions Test.c and compile it a a library using a C/C++ compiler. See additional details below.
In case of Microsoft Visual C++ you need to do:
Start a new project with target set to DLL
Set the additinal include file location. That can be changed from the compiler menu be selecting Project/Settings.
Now you can run the example program. In case of running Win32 OS you can download: Test.class Test.dll