1. Download the JDK installation package
1. Official website link: https://www.oracle.com/java/technologies/downloads/archive/
2. Scroll down to select the version you want to install (here, we take Java SE 8 as an example)
3. Download the corresponding Linux version
2. Install JDK
1. Open Linux and select the storage directory
2. Upload the installation package you just downloaded
(Just choose a software that can upload local files to Linux. MobaXterm is recommended)
#Enter the folder directory: cd /usr/local/java/
#View files: ls
#Extract the current file: tar -zxvf package name
3. Check whether the installation is successful
4. If it is the openjdk version, it comes with it, just delete it.
yum remove openjdk
3. Configure environment variables
1. Open the profile file and modify the configuration: vim /etc/profile
2. Add the following content (press i to enter file editing mode)
export JAVA_HOME=/usr/local/java/jdk1.8.0_371
export PATH=$ JAVA_HOME/bin:$PATH