Installing Java's JDK and configuration environment variables under Linux

Source: Internet
Author: User
Tags gz file

Every time I feel like this is super simple, but every time you check it out, remember.

To install the JDK under Linux, proceed as follows

1: Download the JDK Package: This chapter uses a file with the suffix tar.gz (no installation required), such as jdk-8u111-linux-x64.tar.gz

2: Save the JDK file to the Linux directory: Use the mkdir command to generate the User/java directory from the console, and put the file under it

3: Unzip the tar.gz file: Through the console, enter User/java, execute $ tar zxvf jdk-8u111-linux-x64.tar.gz, unzip it

4: Configure Environment variables: Open the console, run sudo vi/etc/profile, insert the content you want to configure at the end, press ESC, enter (: Wq Save and exit)

Java_home=/home/gcs/user/java/jdk1.8.0_111path= $JAVA _home/bin: $PATHCLASSPATH =.: $JAVA _home/lib/dt.jar: $JAVA _ Home/lib/tools.jarexport Java_homeexport Pathexport CLASSPATH

5: Run $ source/etc/profile to make the configuration environment effective

6: Run $ java-version to see if it takes effect. If the JDK version number appears, install and configure the environment variable successfully

Installing Java's JDK and configuration environment variables under Linux

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.