The compressed package after downloading jdk placed in / usr / local directory
tar -zxvf jdk-8u231-linux-x64.tar.gz
Modify the directory name
mv jdk-8u231-linux-x64 java
Configuration environment variable
vi / etc / profile # global configuration environment variable file # add content to look at the bottom of the configuration file Export JAVA_HOME = / usr / local / the Java Export the PATH = $ the PATH: $ JAVA_HOME / bin # Save and exit source / etc / profile # the configuration file to take effect
Face to view the configuration of the environment is in effect
jps # or java -version
If wrong, please point out!