When GNU announced the release of GCC 4.0.0 four days ago, the Java community paid little attention. The prevailing sentiment is "Nah, it's a C++ compiler, whatever!"
And that would be a huge mistake, for GCC 4.0.0 includes a complete Java compiler and an almost complete set of the standard Java libraries. AWT and Swing are progressing rapidly in the GNU Classpath project, which provides the Java class library for GCJ and other JavaVM projects!
When I last wrote about GCJ, the Java compiler in GCC, 844 days ago, the compiler just started to build under the mingw tool chain, and Eclipse made its first run under GCJs Java interpreter, gij after some tweaking of both GCJ and Eclipse.
When I tested out the latest GCC yesterday, paying attention to the Java stack, I was really impressed with the progress the GCJ folks has made in the last two and half years. Almost all of my existing Java sources that compile with Sun JDK 1.4 also compiles with GCJ. AWT based GUI programs (such as those found in Java In a Nutshell, 1st and 2nd edition, runs on my Fedora Core 3, as native programs, using the GTK based peers. Eclipse can now be compiled with GCJ, into a native program on Linux. And it will ship with Fedora Core 4, scheduled for June 4, 2005!
Being part of GCC, GCJ compiled native code can be debugged with gdb, profiled with gprof. Although not yet working, it should be possible to generate coverage information for GCJ compiled application with gcov.
GCJ fulfills the needs for Java in many situations where the Sun JDK does not because of its licensing schemes. While Sun's goal of keeping its Java compatible is a noble one, in practical terms it has produced much forking and alternative implementations:
Microsoft's DotNET (because the Sun license is not good enough for Microsoft)
Eclipse and SWT (because the JCP process is not good enough for folks at IBM)
JBoss (can't claim to be J2EE compatible for a long time)
GCJ+Classpath (because the Sun license does not allow the JDK to be distributed with Linux distributions)
My prediction is that before long, Java library writers, especially the Open Source and Free Software ones, will care that their library compiles both with the Sun JDK and GCJ.
And a couple of years from now, we may wake up in a world where GCJ dominates in the Free Software realm while proprietary JDKs dominate in Enterprise computing.