CentOS 7 install jdk1.8 tutorial

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
Insert picture description here
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
Insert picture description 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

Insert picture description here

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

Insert picture description here
Wait for the transfer to complete
Insert picture description here
Use ls to see if the transfer is complete

ls

Insert picture description here
After completion, use the unzip command to unzip the jdk file

tar -zxvf jdk-8u281-linux-i586.tar.gz

Insert picture description here
Decompression complete view
Insert picture description here

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

Insert picture description here
Reload the configuration file of environment variables

source /etc/profile

Insert picture description here

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

Insert picture description here

Original by weixin_45351743

Guess you like

Origin blog.csdn.net/weixin_45351743/article/details/114016334