Install Java and Eclipse on Ubuntu 14.04

By Rémi GATTAZ RICM3 Polytech

Install Java

We will install java 1.6, 1.7 and 1.8. You most likely will only need to use the 1.7 or 1.8 versions but installing them won't harm and it might prove usefull.

For java 1.7 and 1.8 it's quite easy.

$ sudo apt-get install openjdk-6-jdk openjdk-7-jdk

Java 1.8 is sadly not on ubuntu 14.04 default repositories. So to install it, you will need to add another repository.

$ sudo add-apt-repository ppa:openjdk-r/ppa
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

Now that you have all 3 versions installed, we will set the system default version. Obviously, you can choose whichever version you can. I'd still advise you to use to 1.8 version.

$ sudo update-java-alternatives -s java-1.8.0-openjdk-amd64

Install Eclipse

If you want to install the latest version of eclipse, you will need to do it 0manually. But if you have never used eclipse or simply don't need the latest version, then you can just use the Ubuntu repositories. Installing it is thus just as easy as installing any other software.

$ sudo apt-get install eclipse

Once it is installed, you can start it as any other "visual" application by finding a shortcut in your application menu.

Testing java and eclipse

No need to write a 'Hello World' to test java. Eclipse is a java application. So if it this application works, it means that java is working well.

Comments powered by Disqus