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 am installing openjdk-7 on my Ubuntu 10.04 server
But I find it to be difficult.

I am new to Ubuntu.
I have installed the python software properties as suggested by some advice I saw online and have uncommented these two lines:

deb oneiric partner
deb-src oneiric partner0

Also i have done these two successfully:

sudo add-apt-repository ppa:openjdk/ppa
apt-get update

apt-get install openjdk-7 is not working as I expect.

share|improve this question
apt-get install openjdk-7-jdk, this is the command for you to install jdk.....for other options try pressing tab after openjdk-7- – Vineet Menon May 23 '12 at 8:48
@VineetMenon - if you moved that to an answer I would upvote it – RobotHumans May 23 '12 at 8:53
@aking1012, :D. – Vineet Menon May 23 '12 at 9:00
Big Thanks on teh 'update altertives...." :) – user308092 Jul 22 '14 at 18:37

The correct command is apt-get install openjdk-7-jdk, this is the command for you to install jdk,

for other options, from which I mean doc, jre, source, try pressing tab after openjdk-7- and apt will autocomplete it for you..

share|improve this answer

The following command should install jdk, jre ..

apt-get install openjdk-7-jdk

In case you had previous version of the java installed you have to update your java configuration and set openjdk-7-jre to be your auto (default) using the following command.

sudo update-alternatives --config java
share|improve this answer
You may need to run sudo update-alternatives --config javac as well – adamnfish May 8 '14 at 22:39

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.