Java stuff

To compile:
javac -classpath lib/log4j.jar -d classes src/com/foo/.java

To generate native method C header file (needed to copy signature for C library or include for calls from C to Java):
javah -classpath classes -d include com.foo.NativeTest

To compile C shared library:
gcc -o lib/libnativetest.so -shared -I/usr/local/java/include -I/usr/local/java/include/linux src/com/foo/NativeTest.c -static -lc

To run:
java -cp classes:lib/log4j.jar -Djava.library.path=lib com.foo.MyApp