I asked some question regarding statically building my software a while ago on mailing list: http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410.html and http://www.nabble.com/libgcj_bc.so-not-embedded-t3538410i20.html The final answer was that if I manually do "new DomDocumentBuilderFactory()", GCJ embeds this class within the static executable file, so there would be no NoClassDefFoundError. Doing so does nothing but increasing my app size, and I'm still getting ClassDef error. > As a side note, I am not sure why you want to statically link. Usually > it only makes sense for small embedded environments. I want to run my app on an OLPC machine, which neither have jre nor libgcj. Thanks, Mohsen.