Compilation under GCJ requires special command line parameters to include the org.w3c.dom and org.xml.sax packages. These packages must be linked explicitly using -l-org-w3c-dom and -l-org-xml-sax.
GCJ requires a -C parameter to generate Java class files rather than object code.
See also
Compatibility issues
GCC bug number 6163 requires a Sun 1.4 Java interpreter to run byte code generated by GCC.