To install java on debian 6, I used

add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

The installation finished without any errors. But when I test the current version (java --version), I still get 1.5.0, and not 1.6.x?! Where is the mistake? Do I have to perform some other steps to install Java 6?


On Debian and Debian-based systems usually /usr/bin/java is just a symlink to /etc/alternatives/java. The reason for this design is that many versions of the same software can coexist together (in your case Java 1.5 and 1.6).


sudo update-alternatives --config java

to choose default Java version.

For further information on updates-alternatives see:


| improve this answer | |

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.