Linux installation JDK

Source: Internet
Author: User

1. Connect Linux using SECURECRT
(securecrt: Link: https://pan.baidu.com/s/1o9hPNlC password: xp00)

2, right-click the window, select Connect SFTP Session, such as:

3. In the Sftp window, enter: Put d:jdk-8u151-linux-i586.tar.gz
(Path is the path to the JDK on your own hard drive, jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

4, cd/usr switch to the USR directory. mkdir Java Create folder java. The CD is switched to the root directory. The CP Jdk-8u151-linux-i586.tar.gz/usr/java copies the JDK installation package from the root directory to the Usr/java directory. RM-RF jdk-8u151-linux-i586.tar.gz Remove the installation package from the root directory. Cd/usr/java switch to the Java directory.

5, TAR-ZXVF jdk-8u151-linux-i586.tar.gz decompression, finished LS look at the directory structure, you can see this time in the Java directory more than a jdk1.8.0_151

6, Vim/etc/profile set environment variables, at the front of the file to join

Export java_home=/usr/java/jdk1.8.0_151 export  jre_home=${java_home}/jre  export classpath=.:${java_home}/ Lib:${jre_home}/lib  export  path=${java_home}/bin: $PATH
Then exit edit

7, Source/etc/profile
Execute profile

8, Java-version
Appear:

Java Version "1.8.0_151"
Java (TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot (TM) Client VM (build 25.151-b12, Mixed mode)

This information indicates that the JDK installation was successful

Linux installation JDK

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.