HairLossException 2022-01-26 11:30:43 阅读数:738
stay Linux There are three ways to install software under the system :
- rpm install
- Unzip installation
- yum Online installation
This is just a demonstration rpm There are two ways of installation and decompression installation
Here I offer jdk8 Version of ( You can also download it from the official website )
link :https://pan.baidu.com/s/1BR-ULB2TC1hqU9KqyhhnQQ
Extraction code :5hsa
To /opt Check whether there is this file in the directory
Input instruction java -version
If there is already installed openjdk
- rpm -qa|grep jdk testing jdk Version information
- rpm -e --nodeps java Version information uninstall jdk
Input instruction rpm -ivh jdk-8u221-linux-x64.rpm ( Input jdk Post press Tab Automatic completion )
Installation is complete here
notes :rpm There is no need to configure the environment for installation
Check whether to upload
Input instruction tar -zxvf jdk-8u121-linux-x64.tar.gz -C /opt
Input instruction vim /etc/profile
stay profile At the end of the file, enter :
JAVA_HOME=/opt/jdk1.8.0_121(jdk The installation directory )
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/lib:.
export JAVA_HOME PATH CLASSPATH
How to use vim The editor can refer to This article
If you don't want to shut down and restart, you can go to /etc Use instructions under the directory source profile
use java -version You can see
copyright:author[HairLossException],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/01/202201261130408302.html