Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I have a need to maintain different versions of a certain product written in java, and uses sun's jdk to build. Some older versions of the product need an older jdk (1.5) and the newer ones need jdk 1.6. So, my question is how can I install (and maintain) multiple versions of sun's jdk. I don't want openjdk, icedtea or whatever else, but different versions of sun's jdk itself.

I ask this as I've seen I have the commands python, python2.6 accessible. If I install another python version, I get it as python2.7 although the python command doesn't point to it. This is exactly the kind of setup I need with java. But anything close also works.

Thank you.

share|improve this question
up vote 6 down vote accepted

Yes. you can. Check this article.

Hope this helps.

share|improve this answer
Thanks, I ended up doing a self-contained installation of jdk 1.5 to be used exactly whenever needed. I am not adding it to alternatives though. – Shrikant Sharat Dec 15 '10 at 8:31
I attempted to use this method for Saucy (13.10), and it appears there is not a sun-java6-jdk package available under the backport libraries for this newer version of Ubuntu. – ryanjdillon Sep 5 '13 at 9:51

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.