"Linux" Installation configuration JDK1.8

Source: Internet
Author: User

The first step: download the Linux environment jdk1.8, please go to the (official website) to download the JDK installation files;

To view the Linux operating system number of bits:

[Email protected] ~]# getconf long_bit

Since my Linux is 64-bit, I downloaded the jdk-8u151-linux-x64.tar.gz

As shown in the following:

    

Step Two: create a new /usr/java folder, place the jdk-8u151-linux-x64.tar.gz in the folder, and switch the working directory to /usr/java Directory. As shown in the following:

    

Step Three: Configure environment variables:

Using vim/etc/profile to edit the profile, add the following at the bottom of the /etc/profile :

[Email protected] ~]# Vim/etc/profile

  java_home=/usr/java/jdk1.8.0_151

Path= $JAVA _home/bin: $PATH

Classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar

Export PATH java_home CLASSPATH

    

Fourth Step: use source/etc/profile to make the profile effective immediately

  [Email protected] ~]# Source/etc/profile

Fifth Step: command test

  ①, command not found error is not present with JAVAC commands

②, using Java-version, appears as Java version "1.8.0_151"

③, Echo $JAVA _home;echo $CLASSPATH; Echo $PATH;

    

Ok

"Linux" Installation configuration JDK1.8

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.