1. Download the JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html.
Test file: jdk-8u191-linux-x64.tar.gz
2. Upload the file to the CentOS host through the ftp tool.
3. Enter the installation directory
cd /usr/local/
4. Unzip the installation file to Current directory
tar -zxvf /var/ftp/pub/jdk-8u191-linux-x64.tar.gz
< img alt="Share a picture" src="/wp-content/uploads/images/os/centos/1626797821075.png" >
5. Modify the /etc/profile file , Add configuration information at the end of the file
export JAVA_HOME=/usr/local/jdk1.8.0_191
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:
export PATH=$JAVA_HOME /bin:$PATH
vi /etc/profile
6. Execute the source /etc/profile command to make the configuration take effect
p>
source /etc/profile
7. Execute commands to view jdk version information
java -version
< p>
cd /usr/local /
tar -zxvf /var/ftp/pub/jdk-8u191-linux-x64.tar.gz
vi /etc/profile
source /et c/profile
java -version