You can do it the simple way, write a library in C, declare a native instance ofthe library in Java and call it from there.