Installing JDK on Linux

Source: Internet
Author: User

1 First confirm whether Linux is installed on the Java, if there is no need to install.

Check method: Linux command: java-version

2 If there is no similar hint, it proves that Java is not installed, then see if Linux is 64-bit or 32-bit, so choose which version of the JDK to download

Command: getconf long_bit

3 Downloads jdk8:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

After the download is complete: jdk-8u181-linux-x64.tar.gz

4 after downloading, you can use the FTP tool (FileZilla or WINSCP), the compression package to Linux (set up the JVM folder under the Linux usr/lib, copy the compressed package to the JVM folder)

Go to the JVM folder: CD/USR/LIB/JVM

Decompression JDK-8U181-LINUX-X64.TAR.GZ:TAR-ZXVF jdk-8u181-linux-x64.tar.gz

After unpacking the folder appears as follows: jdk1.8.0_181/

5 Setting environment variables

Modify/etc/The following profile: Vi/etc/profile

The insertion at the end of the file resembles the following:

Export JAVA_HOME=/JDK parent folder path/jdk1.8.0_121 (e.g./root/jvm/jdk1.8.0_121)

Export path= $JAVA _home/bin: $PATH

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

The author adds:

Export java_home=/usr/lib/jvm/jdk1.8.0_181
Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=.:${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH

May use the vim commonly used command to refer to: https://www.cnblogs.com/kxm87/p/9551105.html

6 Let the file you just modified take effect: Source/etc/profile

7 go back to the first step to check the JDK version or enter Java as pop-up if the installation succeeds

Installing JDK on 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.