Installing the JDK under Linux-centos

Source: Internet
Author: User

Install JDK8 under CentOS to install JDK8 as an example

First, download the decompression JDK

1. Go to http://www. Oracle. com/technetwork/java/javase/downloads/ Download the JDK installation file jdk-8u60-linux-x64.tar.gz in jdk8-downloads-2133151.html.

2. Create a new/usr/java folder, place the jdk-8u60-linux-x64.tar.gz under the folder, and switch to the/usr/java directory.

3. Execute the command tar zxvf jdk-8u60-linux-x64.tar.gz to extract the Jdk1.8.0_60 folder after extracting/usr/java directory.

4. With the above steps, the JDK installation is complete. The following begins configuring environment variables.

Second, configure environment variables

1. Execute the Command vim/etc/profile edit the profile.

2. Add the following to the bottom of the/etc/profile:

Java_home=/usr/java/jdk1.8.0_60

Path= $JAVA _home/bin: $PATH

Classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar

Export PATH java_home CLASSPATH

3. Press insert for insertion operation Press ESC to end insert shift+ colon input QW write and save

4. Execute the command source/etc/profile make the profile effective immediately

Third, attention

1. Note that the path in the configuration, it is necessary to put $java_home/bin in front, or use the Java command, the system will find the previous Java, do not look down.

In this way, the JAVA executable file run directory is not $java_home/bin, and in other directories, will cause a lot of problems.

2. With the javac command, no command not found error occurs.

3. Using Java-version, a version of Java Edition "1.8.0_60" appears. Description The installation JDK has been installed successfully!

Installing the JDK under Linux-centos

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.