Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

Thanks

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.