Linux under the Java Environment installation configuration record

Source: Internet
Author: User

Download JDK

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

Two kinds of installation methods:

The first type: *tar.gz compile and install

1. Create a Java file

1 [[email protected] ~]# CD/usr      #进入usr目录 2 [[email protected] usr]# mkdir java #创建java文件

2. Copy the downloaded file to the/usr/java directory:

[Email protected] java]# cp/root/desktop/jdk-8u161-linux-x64.tar.gz/usr/java/

3. Unzip the JDK to the current directory: Get a/usr/java/jdk1.8.0_161/directory

4. Configure Environment variables

[Email protected] java]# vim/etc/profile# file end add java_home=/usr/java/jdk1.8.0_161/classpath= $JAVA _home/lib/path=$ Path: $JAVA _home/binexport path Java_home CLASSPATH

5. Restart the host or execute the command: Source/etc/profile

sudo shutdown-r now

6. View installation Status

[Email protected] java]# java-"1.8.0_161"1.8. 0_161-   25.161-b12, Mixed mode)

The second type: RPM package

The other steps are the same

4. Installing the JDK

1 cd/usr/java23 rpm-ivh jdk-8u161-linux-x64.rpm



Linux Java Environment installation configuration record

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.