CentOS 7 install jdk1.8 (with software)
JVM installation CentOS 7 tutorial: my original
jdk1.8-linux version extraction code: myfq
jdk1.8 official website download
jdk official website download tutorial
Find the downloaded file under the path of the official website, click download
to agree to download, if you don’t have a jdk account, please register by yourself, the registration is very simple, you can register by yourself, no more explanation here
Use CentOS7 package management tool yum to install lrzsz package
Need to use root account to install lrzsz
su root
Enter the password to install
yum install lrzsz
lrzsz transfer jdk1.8 decompression package
Enter the directory you want to install, this is my installation directory
cd /usr/etc
Enter rz to select the downloaded jdk1.8 file
rz
Wait for the transfer to complete
Use ls to see if the transfer is complete
ls
After completion, use the unzip command to unzip the jdk file
tar -zxvf jdk-8u281-linux-i586.tar.gz
Decompression complete view
Configure jdk environment variables
Configure environment variables, modify environment variable files
vi /etc/profile
Click the keyboard i to edit and
finally configure the variable content
JAVA_HOME=/usr/etc/jdk1.8.0_281
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
Click Esc to exit the editing mode, enter the command to save and exit
:wq
Reload the configuration file of environment variables
source /etc/profile
Check if the jdk is installed successfully
View version command to check whether the jdk installation is successful, the following picture indicates that the installation is successful
java -version