The first step, use the yum -y list java\*
command to query the version of jdk to be installed;
The second step, use the yum install -y java-1.8.0-openjdk.x86\_64
command to download and install jdk;
The third step, use java -version
to check whether the installation is successful, output version information means that java has been installed by default in the usr/lib/jvm/
directory.
The first step, click here, log in oracle to get the information of each version of jdk1.8, then enter the /usr/local/soft/
directory, and execute the wget download link
command in it, or yes Download to windows first, upload to the directory of CentOS via xftp, and then use the tar -zxvf jdk-8u241-linux-x64.tar.gz
command to decompress;
The second step, use the vi /etc/profile
command to open the configuration file and enter the following information at the bottom:
export JAVA\_HOME=/usr/local/soft/jdk1.8.0\_241
export CLASSPATH=$:CLASSPATH:$JAVA\_HOME/lib/export PATH=$PATH:$JAVA\_HOME/bin
The third step, use the source /etc/profile
command to activate the configuration information, and then use the java -version
to check whether the installation is successful. The output version information means that java has been installed in /usr/local/soft /jdk1.8.0\_241
directory.
Recommended Posts