Installing JDK under Linux

Source: Internet
Author: User

First, download the JDK

: http://www.oracle.com/technetwork/java/javase/downloads/index.html

View Linxu number of system bits:getconf long_bit

According to the number of bits of the system, download the corresponding version, mine is 64-bit:

Second, unzip the JDK

Unzip the JDK file: (tar-xzf source file target directory), if the target directory does not have permissions, you can use root permissions

Tar-xzf jdk-8u45-linux-x64.tar.gz/usr/share/java/

Third, set environment variables

1. System-Level environment variables:/etc/profile

2. User-level environment variables:/home/User name/.bash_profile

Use the VI command to open:

Vi/etc/profile

Then press i to enter insert mode, add at the end

Export java_home=/usr/share/java/ jdk1.8.0_45

Export path= $JAVA _home/bin: $PATH

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/toos.jar

Then press "ESC" key, then enter : Wq , then return, save exit.

Then execute the following command to make the environment variable effective

Source/etc/profile

Iv. Test whether the JDK is in effect

Java-version

If the following is displayed, the installation is successful:

Java Version "1.8.0_45"

Installing JDK under Linux

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.