Need zlib-devel installed. gcj --main=pkg.MainClass file.java C++ calls to Java: http://www-ti.informatik.uni-tuebingen.de/~thiele/cni/ Change getMethod() to getDeclaredMethod(). Add -lz to the static g++ command. Make *.class file any way you want (may use gcj). g++ -static java.cpp -o java -lgcj -ldl -lpthread -lz