Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 12 down vote accepted

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.

share|improve this answer
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

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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