Installing Java is one of the few things that people do after installing Ubuntu, and in this post we will guide you to install Java on Ubuntu 14.04 with clarifying the differences between the various copies Java.
OpenJDK against JRE against Oracle JDK
Before proceeding to install Java, we must be aware of the differences between these copies of Java, let's take a quick look for these versions:
JRE: It is an abbreviation for (Java Runtime Environment), which is the application you need to pan ordinary users to run applications written in Java, this is all you need if you are not a programmer.
JDK: It is based on the Java Development Kit, and this is what you need to do some development processes and programming related to Java.
OpenJDK: It is the application of open-source Java Development Kit, and this version is also suitable for the needs of most casual users, but the advantage back to the JRE in this context.
Oracle JDK: it is the official version of Oracle's Java Development Kit, and the examples that you use, the editor compile Android Studio.
Java installation on Ubuntu 14.04
# Before starting the installation, you should check whether the Java software installed you actually have to verify the existence of Java in the system, open the terminal Ctrl + Alt + T and paste the following command :
java-version
- If you see the following output or similar :
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
It means that Java is not installed on the computer, and you'll need to install it, so we will proceed to the installation process now.
Installing the JRE
Open a terminal Ctrl + Alt + T and paste the following command :sudo apt-get install default-jre
Installing OpenJDK
Open a terminal Ctrl + Alt + T and paste the following command :sudo apt-get install default-jdk
Installing Oracle JDK
Open a terminal Ctrl + Alt + T and paste the following commands (* Make sure to have high-speed Internet, it will download a lot of files in the case of Oracle JDK).sudo add-apt-repository ppa: webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
(* If you want to install the seventh version of the oracle jdk, replace java8 b java7 in the above commands).