I was fiddling around on Minecraft a moment ago and noticed something strange - It was using OpenJDK 6 (at least for my profile, I don't know what the launcher is using...), which I didn't realize was installed by default. (Of course I should've realized this, I believe Libre Office uses it...Java, that is.)

I usually install the openjdk-7-jre package when setting up my system after a fresh installation.

Is there a reason to keep OpenJDK 6 around? If not, how does one remove it entirely? I tried a simple apt-get autoremove openjdk-6-jre, but that also wanted to remove default-jre , and I don't know what that is or does exactly.

I tested Minecraft with OpenJDK 7, everything seemed just fine!

If it is required to keep it, is there a way to make OpenJDK 7 default for everything else that doesn't require OpenJDK 6?


I did some more searching and found this.

update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
* 0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode

Press enter to keep the current choice[*], or type selection number:

I selected "2" and hit enter.

which java

This only gave me the output /usr/bin/java, not which version it was technically using like the post had said it should.

I also opened Libre Office for fun and looked in the options - It has the option to change which JDK to use, so I swapped that to version 7 as well.

So the question still remains, is OpenJDK 6 required to keep, or can it be removed in place of OpenJDK 7? If I can remove it, how would I go about removing it entirely?


Debian use update-alternative to allow to easily change between various versions of a given program.

take a look at /usr/bin/java

# ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 janv. 19 23:12 /usr/bin/java -> /etc/alternatives/java

This is a link to /etc/alternatives/java:

# ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 45 janv. 19 23:12 /etc/alternatives/java -> /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java

As you see, on my system, i use java-6-openjdk-i386 as my JRE.

take a look on your system at the result of :

readlink -f /usr/bin/java

This command show you the real binary used when you call java.

As for removing openjdk-6, you can safely do it. The package default-jre is just a "dummy" package containing nothing but a dependency to openjdk 6. It is used to ease the installation of Java.

  • Aha, nifty. The readlink did indeed point to the OpenJDK7 package, and thanks for the info on OpenJDK6, but does the command I was attempting above "fully" remove it (including associated packages), or just the base package and the dummy? – user293409 Jan 26 '14 at 14:43
  • i believe it fully remove it. I may be wrong. You may try: apt-get autoremove default-jre default-jre-headless openjdk-6-jre openjdk-6-jre-headless – Biapy Jan 26 '14 at 16:39

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.