Linux CentOS7 installation Jdk1.7__linux

Source: Internet
Author: User
Step One uninstall the original or the self with JDK

Some Linux systems will bring OPENJDK, and we'd better remove the original JDK and install it first.

(1) View current JDK version information with the java-version command

Java-version

(2) using Rpm-qa | grep Java command to query the Java installed by the operating system itself

Rpm-qa | grep java
Step two Download the installation JDK

Found on the Internet, most of the JDK download path has been invalidated, so we recommend to Baidu to find their own, or download at the official website. Much of this information is downloaded using the curl+ address, but we need to be clear about the address path. There is also the way to download the installation package directly, and then throw it into the Linux server, and then unpack.

website address : JDK Download address
Download Address : JDK Download address

Sample version of this article: Jdk-7u79-linux-x64.tar.gz

Put the downloaded FTP tool in a designated directory on Linux, for example:/usr/local/jdk7.
No JDK path to create.

(1) Enter the/usr/local directory

Cd/usr/local

(2) Create jdk7 directory

mkdir Jdk7

(3) View the files in the/usr/local/jdk7 directory

Ll/usr/local/jdk7 or Ls/usr/local/jdk7

(4) Decompression JDK Compression pack

(5) If you need to move the JDK installation file path

mv/usr/local/jdk7/jdk1.7.0_79/usr/local/java/jdk1.7.0_79
setting JDK Environment variables

(1) After the installation is completed, you need to configure the environment variables, edit the/etc/profile file

Vi/etc/profile

(2) Add the following configuration at the end of the file

Export java_home=/usr/local/jdk7/jdk1.7.0_79 
export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/ Dt.jar: $JAVA _home/lib/tools.jar 
export path= $PATH: $JAVA _home/bin


Note: Java_home is the installation directory address of your own JDK installation

(3) Effective JDK environment variables

Source/etc/profile

(4) Check whether the JDK is installed successfully

Java-version

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.