Centos 7 Installation jdk1.7

Source: Internet
Author: User

Installing the JDK in Linux is a trivial matter, just learn Linux to leave a note for yourself. Just install CentOS, which can come with JDK, but this does not affect, just download your own JDK and then replace the corresponding environment variables.

1, download the corresponding JDK, enter the command:
wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz

2, unzip the source package to the/usr/local/folder, enter the command:

TAR-ZXVF jdk-7u79-linux-x64.tar.gz/usr/local/

3, after you can delete the source package, of course, do not delete the line.

RM jdk-7u79-linux-x64.tar.gz

4, the configuration of the JDK environment variables, the configuration of the environment variables in Linux, the personal understanding is in this file/etc/profile
, so we just need to configure it in this file. Enter the command:

Vi/etc/profile

Open and add at the end:

Export java_home=/user/local/jdk1.7 #最后面jdk1.7 The name needs to fill in the second step after the decompression path
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin

Then press the ESC key to enter: Wq to save the exit. One of the things to note is that the case in Linu is strictly distinguished, and there are no spaces on either side of the equal sign.

5, re-make the profile effective, enter the command:

Source/etc/profile

This configures the environment variable to be effective. Then you can check to see if the JDK is configured to take effect, perform a low six-step

6. View version number

Java-version

If the relevant information is displayed, you have successfully installed it.

Centos 7 Installation jdk1.7

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.