Finding a working copy of the GNU compiler

Opinion
Sep 18, 20072 mins

I want to use the GNU compiler for Java on my Mac but the GNU compiler in the Apple XCode package does not include it. I installed all the developer tools, the X-Windows environment package and downloaded the source code for the latest GCC release but I keep getting linker errors when I try to build the compiler from source. How can I get a working copy of the GNU compiler for Java for my OS X Mac?

I want to use the GNU compiler for Java on my Mac but the GNU compiler in the Apple XCode package does not include it. I installed all the developer tools, the X-Windows environment package and downloaded the source code for the latest GCC release but I keep getting linker errors when I try to build the compiler from source. How can I get a working copy of the GNU compiler for Java for my Mac OS X?

There are at least two open source porting projects for the Mac that provide versions of the GNU Compiler Collection (GCC) that include the GNU Compiler for Java features you are looking for. MacPorts and Fink both provide access to GNU software that has been modified for the Mac OS X environment. Fink uses Debian Linux tools like dpkg and apt-get for package management while MacPorts uses its own set of package management commands. Both projects provide source code versions of GCC that will build and run under Mac OS X. In addition to the compiler collection, both projects provide large collections of binary and source packages modified specifically for the Macintosh. Installing the tools for both projects is similar, you download and install the MacPorts or Fink installer, then run an update procedure to make sure your package is up to date and then you follow the instructions for whichever toolset you’ve chosen to download and install the GNU packages you’re interested in. Between Fink and MacPorts, Mac ready versions of most of the GNU software you could ever want are available for installation without the headache of pinpointing and fixing or working around the quirks of Mac OS during software builds.