Sunday 31 July 2016

How to Install Oracle JAVA 8 (JDK 8u91) and Eclipse for C++/Java on Ubuntu

This article will help you to Install Oracle JAVA 8 (JDK/JRE 8u91) on Ubuntu 16.04, 15.10, 14.04 & 12.04 LTS and 10.04


Installing Java 8 on Ubuntu

First you need to add webupd8team Java PPA repository in your system and install Oracle Java 8 using following set of commands.
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Verify Installed Java Version

After successfully installing oracle Java using above step verify installed version using following command.

cnm@contentnmedia:~$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Managing Java

There can be multiple Java installations on one server. You can configure which version is the default for use in the command line by using update-alternatives, which manages which symbolic links are used for different commands.

sudo update-alternatives --config java

You can now choose the number to use as a default. This can also be done for other Java commands, such as the compiler (javac), the documentation generator (javadoc), the JAR signing tool (jarsigner), and more. You can use the following command, filling in the command you want to customize.

sudo update-alternatives --config command

Remove Java8
sudo apt-get --purge remove oracle-java8-installer

Eclipse

sudo apt-get install eclipse-cdt

Note that this will get eclipse installed with open jdk.

No comments :

Post a Comment