To download the jdk rpm package, you can download it from the Oracle official website: http://www.oracle.com//java/javase//index.html Copy the downloaded rpm package to the Linux server and execute the following command to install it:
1. Download the jdk rpm package, which can be downloaded from Oracle’s official website: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Copy the downloaded rpm package to the Linux server and execute the following command to install it:
# rpm -ivh jdk-8u191-linux-x64.rpm
3. Check whether the installation is successful and execute the following command:
# java -version
4. Set environment variables, open the /etc/profile file, and add the following content:
export JA_HOME=/usr/java/jdk1.8.0_191
export PATH=$PATH:$JA_HOME/bin
5. To make the environment variables take effect, execute the following command:
# source /etc/profile