Ubuntu 14.04 install java method

  

Because Linux software installation requires the use of commands, many people encountered a lot of problems when installing java, the following small series Ubuntu14.04 as an example, give you a detailed introduction to java The installation, let's learn together.

JRE vs OpenJDK vs Oracle JDK

As we continue to learn how to install Java before, let us quickly understand the differences between the JRE, OpenJDK and Oracle JDK.

JRE (Java Runtime Environment), which is the environment you normally need to run a Java-based application. If you are not a programmer, these are enough for your needs.

JDK stands for Java Development Kit, and if you want to do some Java development (reader), this is exactly what you need.

OpenJDK is an open source implementation of the Java Development Kit, the official Oracle version of the Java Development Kit. Although OpenJDK is sufficient for most cases, many programs such as Android Studio recommend using the Oracle JDK to avoid UI/performance issues.

Check if Java is already installed on Ubuntu

To open the terminal, use the following command:

java -version

If you see something like the following Output, which means you have not installed Java:

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< Br>

Try: sudo apt-get install

Installing Java on Ubuntu and Linux Mint

After reading the various types & lsquo;Java’, let’s see how to install they.

Installing JRE on Ubuntu and Linux Mint

To open a terminal, use the following command to install JRE:

sudo apt-get install default-jre

Install OpenJDK on Ubuntu and Linux Mint

In the terminal, install the OpenJDK Java Development Kit using the following command:

sudo apt-get install default-jdk

If you want to install Java 7 or Java 6 and so on, you can use openjdk-7-jdk/openjdk-6jdk, but remember to install openjdk-7-jre/openjdk-6-jre before this.

Installing Oracle JDK on Ubuntu and Linux Mint

Use the following command to install it. It only takes a few moments, it will download a lot of files, and you have to make sure your network environment is good. :

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 Java 7 (ie Java 1.7), use java7 instead of java8 in the above command.

The above is the introduction of Ubuntu14.04 java method, as for other versions of Linux to install java method and the method described in this article is somewhat similar, refer to the method of this article to install.

Copyright © Windows knowledge All Rights Reserved