Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 Ubuntu. I want to install the Sun JDK version 6 using the command line (apt-get). How do I do that. What is the name of the package?

Or is the open JDK version the only option.

share|improve this question
Don't use OpenJDK at the moment for Swing applications. It will result in truncated controls, paint problems or other mysterious bugs. – Mike L. Sep 14 '10 at 13:57

Assuming it's Ubuntu 10.04,

sudo add-apt-repository "deb lucid partner"
sudo apt-get update && sudo apt-get install sun-java6-jdk

should work.

share|improve this answer

You can install by apt-get:

apt-get install sun-java6-jre sun-java6-jdk
share|improve this answer
Ramesh ... I get this output. Reading package lists... Done Building dependency tree Reading state information... Done Package sun-java6-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package sun-java6-jdk has no installation candidate – Ankur Sep 14 '10 at 7:55

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.