gcj -fsyntax-only should compile a .java file and throw away the results. (Arguably it should verify the resulting bytecode as well.) This doesn't happen on trunk... it runs jc1 but not ecj1:
opsy. gcj -v -fsyntax-only -Werror HelloWorld.java Using built-in specs. Reading specs from /home/tromey/gnu/4.2/install/lib/gcc/i686-pc-linux-gnu/4.2.0/../../../libgcj.spec rename spec startfile to startfileorig rename spec lib to liborig Target: i686-pc-linux-gnu Configured with: ../trunk/configure --prefix=/home/tromey/gnu/4.2/install --enable-languages=c++,java,fortran --enable-threads=posix --enable-checking=yes --enable-java-awt=gtk --disable-static --disable-bootstrap --enable-java-maintainer-mode Thread model: posix gcc version 4.2.0 20070116 (prerelease) /home/tromey/gnu/4.2/install/libexec/gcc/i686-pc-linux-gnu/4.2.0/jc1 HelloWorld.java -fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase HelloWorld.java -mtune=generic -auxbase HelloWorld -g1 -Werror -version -fsyntax-only -o /dev/null GNU Java version 4.2.0 20070116 (prerelease) (i686-pc-linux-gnu) compiled by GNU C version 4.1.1 20060525 (Red Hat 4.1.1-1). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Class path starts here: ./ /home/tromey/gnu/4.2/install/share/java/libgcj-4.2.0.jar/ (system) (zip) -- Summary: gcj -fsyntax-only does not work properly Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tromey at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30644