CentOS installation JDK, configuration environment variables

Source: Internet
Author: User

1. Verify if there is an installation

Java-version

2. If you need to upgrade a new version of the JDK or want to reinstall the JDK, you need to uninstall the original JDK first

Yum-y Remove java*

3. View the list of Java resources in Yum source
Command: yum list java*

4. Select Version Installation

yum -y install java-1.8.0*

5, check the location and index, find the installation directory, easy to configure the Java environment variables

which Java

6. Enter the system environment variable file

Vim/etc/profile

7. Add Configuration

List of the fifth steps in export java_home=

Export JRE_HOME=${JAVA_HOME}/JRE
Export Classpath=${java_home}/lib:${jre_home}/lib
Export Path=${java_home}/bin: $PATH

8. Make the configuration in the file effective

Source/etc/profile

9. Verification

Java-version

CentOS installation JDK, configuration environment variables

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.