CentOS configuration environment Variables for JDK

Source: Internet
Author: User

1, first of all, the JDK under the CentOS environment configuration in two cases, has been the root user-level JDK configuration, the other is the other user group-level configuration. The root user-level configuration is explained here.

We have downloaded the directory to unzip the JDK. As follows

2, edit the environment variable configuration file:

Vi/etc/profile

Add the following code at the tail:

#JDK全局环境变量配置
Export java_home=/usr/local/java/jdk1.8.0_181
Export Classpath=$:classpath: $JAVA _home/lib/
Export path= $PATH: $JAVA _home/bin

Also modify the storage location of the JDK on the export java_home= own Linux . The other two lines do not need to be modified

3. Let the environment variable configuration take effect. Use the following command:source/etc/profile

4, use Java and Javac command to query whether the configuration is in effect.

When this happens, the environment variables are basically well configured.

Java

Javac

If you want to know how to configure the user level, you can refer to this document: 78486711?locationnum=9&fps=1

CentOS configuration environment Variables for JDK

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.