Building IcedTea6 on Debian etch (stable)

As those who’ve had the unfortunate luck of being in our IRC channel over the past few days will know, I’ve been trying to build IcedTea6 on our Debian etch server again. The good news is it looks like I may have succeeded this time, with some help from Christian Thalinger (twisti) and Gary Benson (gbenson).

Basically most of the tools that come with etch will be useless in your task. The versions of Kaffe, GCJ and GNU Classpath+JamVM that come with it don’t support the 1.5 language extensions. To add insult to injury, because the gcj backport used by Fedora is ‘4.1′, IcedTea won’t scream at you for a default ./configure; make. Instead, the OpenJDK sanity check will tell you that you don’t have a 1.6 VM to bootstrap with (although you only actually need a 1.5 one…). This is because IcedTea will symlink bootstrap/jdk1.6.0/bin/java to the gij that is part of etch, which reports itself as 1.4. Similarly, the jar file it picks up is a pre-generics version of Classpath that can’t be used even with a VM that claims to be 1.5.

So you need to build your own Classpath Java stack before proceeding with trying out IcedTea6. This machine is used to do my regression testing for Classpath so I already had an install of 0.97.1, but it’s simple enough to get a copy of GNU Classpath and a compatible VM if you don’t. You CAN use what is installed with etch to build this. The simplest way to do that is to install the java-gcj-compat-dev package which should give you a native version of ecj.

Using this, you can download Classpath 0.97 or any prior version up to 0.95 (the first to include the code merged from the generics branch). ./configure; make; make install should work, but you probably want to use --prefix to install it in a local directory rather than /usr/local/classpath. --disable-plugin is something I also usually add to avoid having to had the Mozilla headers.

Once installed, you need to add a 1.5 VM that works with this. CACAO (from the Mercurial repository), JamVM or the new Kaffe release should work. I used CACAO. You can then configure IcedTea6 by pointing it at the new install. Assuming $CLASSPATH is where you installed everything:


./configure --with-java=$CLASSPATH/bin/java --with-libgcj-jar=$CLASSPATH/share/classpath/glibj.zip --with-jar=$CLASSPATH/bin/gjar --with-rmic=$CLASSPATH/bin/grmic --with-javah=$CLASSPATH/bin/gjavah

Before building, you also need to patch glibc (thanks to twisti for this tip). Don’t worry! It’s not too scary, just a simple change to a shell script, to make it the same as in more recent versions. On x86, the change is in /usr/lib/libc.so. The last line should read:


GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED (/lib/ld-linux.so.2 ) )

If you’re on x86_64 or ppc64 (or any 64-bit platform i guess), you need to patch /usr/lib64/libc.so:


GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld64.so.1 )

That done, you should be able to run make and hopefully reach the message that IcedTea is served. YMMV of course, so let me know how you get on. This was quite a bit easier than when I last remember trying, so hats off to the IcedTea folks for all their hard work. Next stop, Solaris… ;)

5 Responses to “Building IcedTea6 on Debian etch (stable)”

  1. A. Coder Says:

    On my AMD64 Etch install, I had to edit the last line of /usr/lib/libc.so to read

    GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED (/lib/ld-linux-x86-64.so.2 ) )

    I’m trying to build with jamvm, so I built it with
    ./configure –prefix $CLASSPATH ; make
    which seemed to work, though there were a lot of warnings.

    The icedtea build didn’t work, though. The configure went OK ,but I still got the following errors:

    WARNING: The version of findbugs being used is older than
    the required version of ‘1.1′.
    The version of findbugs found was ‘’.

    I guess this is findbugs.sf.net. Did you bother with this? Did you do a manual install of it?

    ERROR: Your BOOTDIR environment variable does not point
    to a valid JDK for bootstrapping this build.
    A JDK 6 build must be bootstrapped using
    JDK 1.6.0 fcs (or later).
    Apparently, your bootstrap JDK is version 1.4
    Please update your ALT_BOOTDIR setting and start your build again.

    Seems to be using gcj, not jamvm, despite using the build options you suggested. Might be doing something wrong I suppose; I’m setting CLASSPATH using something like
    CLASSPATH=/foo/bar ./configure –baz-bop=$CLASSPATH/bam

    ERROR: FreeType version 2.3.0 or higher is required.

    Didn’t you have to manually install this?

  2. A. Coder Says:

    I installed fastjar and tried
    ./configure –with-java=$CLASSPATH/bin/jamvm –with-libgcj-jar=$CLASSPATH/share/jamvm/classes.zip –with-jar=/usr/bin/fastjar ; make
    (I couldn’t find gjavah or grmic) but the result was the same, “Apparently, your bootstrap JDK is version 1.4″

  3. A. Coder Says:

    Well, I’ve built and installed freetype2.3.5, but I’m not sure how to set the following variables.

    FREETYPE2_CFLAGS C compiler flags for FREETYPE2
    FREETYPE2_LIBS linker flags for FREETYPE2
    (both overriding pkg-config)

    Manually going into bootstrap/jdk1.6.0/bin and recreating the symlinks manually stops the JDK version error appearing.

  4. A. Coder Says:

    A load of new instructions have just been posted this afternoon at http://icedtea.classpath.org/wiki/DebianBuildingInstructions
    I’ll have a look at those later on…

  5. gnu_andrew Says:

    As regards the 1.4 message, check what jamvm -version says. I think this only recently switched to use 1.5, may even still be only in CVS. CACAO did this earlier which is what I used.

    The findbugs warning is okay to ignore, unless you want to particularly run findbugs — no path is passed to the OpenJDK build by IcedTea for this anyway.

    I missed out the freetype stuff, sorry. I’ll post an update with links to the backported versions that it should then just find (they replace the etch versions with the newer version from lenny compiled against etch).

    The wiki page should be the same; I updated it when I wrote the blog.

Leave a Reply