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 want to install java so that I can use the android sdk

Using the software centre I installed 'ubuntu restricted extras' (as it says that it includes java). The software centre looks like this has been successful.

In the terminal if I type: java -version It comes back with....

The program 'java' can be found in the following packages:
* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install <selected package>

Q1) Does this mean Java is not installed?

Q2) Is there a better way to report which type and version of java is installed

Q3) If it is not installed then what could have gone wrong with the installations of 'extras'

Q4) Is there a simple way of installing the latest java runtime? I.e. without having to know what the latest verion of java is and without downloading and unzipping and running scripts but just using the standard add-apt-repository + apt-get install.


share|improve this question
up vote 0 down vote accepted

This means that you have several openjdk's installed but not Oracle Java. You can choose between those with sudo update-alternatives --config javac.

But to install oracle java, you should follow this guide.

If you want you can uninstall openjdk before installing oracle java with sudo apt-get remove openjdk-6-jre default-jre default-jre-headless or/and follow this to uninstall openjdk7.

If you want you can keep them as well, but it is up to what you want. Openjdk is fine as well.

Hope it was clear enough. Be well.

share|improve this answer

You can use OpenJdk as has been pointed out but if you want Oracle Java you can follow this guide.

Hope it helps!

share|improve this answer

Execute sudo apt-get install default-jre

share|improve this answer

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.