Install the latest version of Java JDK on Linux

Source: Internet
Author: User

Prior to writing an article on MC Building (http://www.cnblogs.com/apollospotatolikett/p/6149042.html), the JDK used in the article is not the latest version, then did not elaborate how to download the latest version of the installation, Say it in detail this time.

Before we start to download the installation, we'll do a few things:

Check if the system has Java installed and displays the version:

# java-version

Use the above command to display, if you do not find the installation, you can use:

# sudo apt-getdefault-jdk

Install the default version of the warehouse, but this version is not up to date, and then use the version Check command to get

The picture shows that the "1.7.0_121" version is installed, not what we want.

Then start installing the latest version of the JDK below:

The first step is to download the latest JDK installation package

First login to the Java website (http://www.oracle.com/technetwork/java/javase/downloads/index.html), click on the button to enter the JDK download page, It can be seen from the graph that the latest version is 8u111/8u112.

Enter the download page as follows:

We selected 8u111 version download as a demonstration, if there is a new version of the installation method is the same. Select the appropriate version to download note X86 refers to a 32-bit machine, X64 refers to 64-bit machine.

There are two ways to download:

1. Command download

# Axel http://202.117.4.101/cache/12/02/oracle.com/206932154def5188d39270dd88e56b07/ Jdk-8u111-linux-x64.tar.gz

With this command you can download the file to the directory, if you do not have the Axel installed:

# sudo apt-get install Axel

Just a little bit of installation.

2. Direct download

Of course, you can also download directly on the website with the download, and finally put in the corresponding directory on the line.

Install the JDK in the second step

Locate the appropriate installation file jdk-8u111-linux-x64.tar.gz, using:

# tar ZXVF jdk-8u111-linux-x64.tar.gz

You can extract the files to the current directory and get a folder jdk1.8.0_111.

Next install the file into the system, first create a directory (this command must be root execution, or there will be a permissions problem)

# Mkdir/usr/java

Move the Java file in (note that there are spaces between the jdk1.8.0_111 and the directory)

# MV Jdk1. 8. 0_111/usr/java

Finally do a link to the system, enter the following command (note space)

# update-alternatives--install/usr/bin/java Java/usr/java/jdk1. 8 1100

To detect whether a command was successfully used:

# java-version

Display is the success

It's very simple ~ go ahead and try it!

Install the latest version of Java JDK on Linux

Related Article

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.