Both OpenJDK and GCJ are available for install on Debian, and now I wonder what's happening. Don't these provide same functionality?


Debian's stance is that, beyond certain critical system components which are considered required¹, there is no preferred software. If two programs provide similar functionality, and they're both suitable for Debian², and there's a Debian developer willing to maintain each package, then both programs will end up in Debian. The idea is that it's up to the user to choose which program to use.

On a given system, at most one Java implementation can be /usr/bin/java. This is decided through the alternatives mechanism: each Java implementation has a priority (decided by common agreement amongst the maintainers of the Debian packages involved), and whichever implementation that is installed on a particular system has the highest priority gets to be /usr/bin/java. The system administrator can override this by manually changing the /etc/alternatives/java symbolic link. And if there are several JVMs installed, users can choose on a case-by-case basis to run /usr/lib/jvm/java-6-openjdk/jre/bin/java, /usr/lib/jvm/java-6-sun/jre/bin/java, etc.

¹ Or at least strongly advised.
² The best-known requirement is that the program must be free software, with some exceptions (non-free); another is that it must not be too buggy.

  • 1
    System administrators messing with alternatives might also want to use "update-alternatives -config java", which lists the available providers and then sets the symlink as per your selection. – Thomas Themel Dec 1 '10 at 11:39

They are fine with both for the most part: OpenJDK is installed by default on supported platforms, otherwise GCJ will be used instead.

Reference: http://wiki.debian.org/Java

  • 1
    Debian will use OpenJDK by default and if it's not supported it will use GCJ. – OneOfOne Nov 30 '10 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.