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