How to install Java in Ubuntu 14.04

Source: Internet
Author: User
Tags linux mint

Want to know how to install Java in Ubuntu 14.04? Installing Java is definitely one of the first things to do after installing Ubuntu 14.04 (see http://www.linuxidc.com/Linux/2014-04/100398.htm), and it's easy.

Many people hate Java, but there's a good chance you'll need to install Java for some reason, even if you hate it. In this article, we'll show you how to install Java in Ubuntu 14.04 (and possibly the same for Linux Mint 17).

JRE vs OpenJDK vs Oracle JDK

Before we continue to learn how to install Java, let's get a quick look at the differences between JRE, OPENJDK, and Oracle JDK.

    • JRE (Java Runtime Environment), which is the environment you need to run a Java-language-based application normally. If you are not a program clerk, these are enough for your needs.
    • The JDK represents the Java SDK, and if you want to do something about Java development (read programs), that's exactly what you need.
    • OPENJDK is an open source implementation of the Java SDK, the Oracle JDK is the official Oracle version of the Java Development Kit. Although OPENJDK is sufficient for most cases, many programs, such as Android Studio, recommend using Oracle JDK to avoid ui/performance issues.
Check to see if Java is installed on Ubuntu

To open the terminal, use the following command:

    1. Java -version

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

  1. The program 'java' can is 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 looking at the different types of ' Java ', let's look at how to install them.

Installing the JRE on Ubuntu and Linux Mint

Open the terminal and install the JRE using the following command:

    1. sudo apt-get install default-JRE
Install OPENJDK on Ubuntu and Linux Mint

At the terminal, install the OPENJDK Java SDK using the following command:

    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 this.

Install Oracle JDK on Ubuntu and Linux Mint

Use the following command to install, just some time, it will download a lot of files, and you want to make sure 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 JAVA7 instead of java8 in the command above.

Transferred from:http://www.linuxidc.com/Linux/2014-09/106445.htm

How to install Java (go) in Ubuntu 14.04

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.