Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 installed 11.04 in my machine. I have installed JDK6 from the repository. My problem is I need to install JDK5 in my machine I have used the following command but its not working.

~$ sudo apt-get install sun-java5-jdk

It gives the following messages:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package sun-java5-jdk

Please help

share|improve this question
up vote 4 down vote accepted

You can manually download it from here: and then install it.

share|improve this answer
As a java developer I can confirm that a manual install is the best option for java. Just make sure that you set your paths correctly: export JAVA_HOME=/data/dev/java/java6 - export PATH=$JAVA_HOME/bin:$PATH. Pretty easy to switch between different java versions and JDKs that way. – jan groth Feb 6 '12 at 12:14
Can you also give the instructions for installing it once the .bin file is downloaded. Oracle does not have any instructions. Thanks in advance. – Jus12 May 23 '12 at 9:56

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.