How to install Java in Ubuntu 14.04

Source: Internet
Author: User

How to install Java in Ubuntu 14.04

Want to know how to install Java in Ubuntu 14.04? Installing Java is certainly one of the first few things to be done after Ubuntu 14.04 is installed (SEE), and this is also very simple.

Many people hate Java, but for some reason you may need to install Java, although you hate it. In this article, we will show you how to install Java on Ubuntu 14.04 (or Linux Mint 17 also applies ).

JRE vs OpenJDK vs Oracle JDK

Before continuing to learn how to install Java, Let's quickly understand the differences between JRE, OpenJDK, and Oracle JDK.

  • JRE (Java Runtime Environment) is the Environment you need to run a Java-based application. If you are not a programmer, these are enough for your needs.
  • JDK represents the Java Development Kit. If you want to develop Java (read the Program), this is exactly what you need.
  • OpenJDK is an open-source implementation of Java development kit, and Oracle JDK is the official Oracle version of Java Development Kit. Although OpenJDK is sufficient for most cases, we recommend that you use Oracle JDK for many programs such as Android Studio to avoid UI/performance problems.
Check if Java has been installed on Ubuntu

Open the terminal and run the following command:

  1. Java-version

If you see the following output, it means that you have not installed Java:

  1. The program 'java' can be found in the following packages:
  2. * Default-jre
  3. * Gcj-4.6-jre-headless
  4. * Openjdk-6-jre-headless
  5. * Gcj-4.5-jre-headless
  6. * Openjdk-7-jre-headless
  7. Try: sudo apt-get install
Install Java on Ubuntu and Linux Mint

After reading different types of 'java', let's see how to install them.

Install JRE on Ubuntu and Linux Mint

Open the terminal and run the following command to install JRE:

  1. Sudo apt-get install default-jre
Install OpenJDK on Ubuntu and Linux Mint

On the terminal, run the following command to install the OpenJDK Java Development Kit:

  1. Sudo apt-get install default-jdk

Specifically, 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 that.

Install Oracle JDK on Ubuntu and Linux Mint

Use the following command to install it. It takes only some time to download many files, and you need to ensure that your network environment is good:

  1. Sudo add-apt-repository ppa: webupd8team/java
  2. Sudo apt-get update
  3. Sudo apt-get install oracle-java8-installer
  4. Sudo apt-get install oracle-java8-set-default

If you want to install Java 7 (I. e Java 1.7), use Java 7 in the preceding command to replace Java 8.

I hope this article will help you learn how to install Java on Ubuntu, Linux Mint, and other Ubuntu-based Linux distributions. We welcome all questions or suggestions.

Install JDK 8 on Ubuntu 14.04

Download, install, and configure Ubuntu 14.04

Ubuntu 14.04 system:

Ubuntu 14.04 text tutorial on hard drive installation in Windows 7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.