Centos 7 Installation JDK configuration environment variables

Source: Internet
Author: User

In the Centos7 terminal, we enter java-version to see the Java version, but the input javac does not respond

The reason is that the OpenJDK JRE is not a real JDK preinstalled in the system, so you have to install it yourself and then configure the variable.

1. Yum List java-*

2, install the corresponding version of the JDK, generally contains devel is the real JDK, such as: java-1.8.0-openjdk-devel.x86_64

Command: Yum install java-1.8.0-openjdk-devel.x86_64

3, Vim/etc/profile

Add environment variables (note that semicolons are split):

Export Java_home=/usr/lib/jvm/java
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JAVA _home/jre/lib/rt.jar
Export path= $PATH: $JAVA _home/bin

4, Source/etc/profile

Make the changes come into effect so that javac will react.

RPM Mode: http://pepho.blog.163.com/blog/static/13805620141202711972/

Centos 7 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.