CentOS7, installing the jdk1.8u73 in GZ format

Source: Internet
Author: User

Preparatory work:

1. Download jdk-8u73-linux-x64.tar.gz from Oracle official website using wget

2. Tar tool (CentOS7 Minimal contains this tool by default)

3, Nano (small text editor, single function, but small, all kinds of commands are prompted, unlike VI, Operation needs to turn manual)


User preparation:

1, switch to the root user (if not switch, see here)


Steps:

Suppose we save the JDK installation file under the ~/software/to extract it to/opt/java/.

0. Observe the installation package file to determine its structure

Tar tf ~/software/jdk-8u73-linux-x64.tar.gz

With this command above, we can see that the directory structure in the installation package is relatively simple, and the GZ file contains only one folder jdk1.8.0_73. So, we just need to unzip the installation package and get this folder directly.

1. Create the target directory

mkdir/opt/java/

2. Enter the/opt/java/directory

Cd/opt/java

3. Unpack the installation package

Tar zxvf/home/rrrrr/software/jdk-8u73-linux-x64.tar.gz

4, see if it is/opt/java below a directory jdk1.8.0_73

5. Setting environment variables for JDK

Nano/home/rrrrr/.bash_profile

Go to the Nano editor. Add the following information in the editor:

Export Java_home=/opt/java/jdk1.8.0_73export jre_home=/opt/java/jdk1.8.0_73/jreexport PATH= $PATH: $JAVA _home/bin:$ Jre_home/bin

Press Ctrl+o, then enter, then ctrl+x exit Nano

6, immediately apply the 5th step to configure the information

Source/home/rrrrr/.bash_profile

7. Testing

Java-version

This article is from the "Bitterjava" blog, make sure to keep this source http://rickqin.blog.51cto.com/1096449/1755062

CentOS7, installing the jdk1.8u73 in GZ format

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.