rpm -qa|grep jdk
yum -y remove the file found
Official website download address
tar -zxvf JDK compressed file name-C /usr/local/java
Add in the /ect/profile file and enter
vim /etc/profile
Add to
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export JRE_HOME=/usr/local/java/jdk1.8.0_144/jre
export CLASSPATH=./:/usr/local/java/jdk1.8.0_144/lib:/usr/local/java/jdk1.8.0_144/jre/lib
export PATH=$PATH:/usr/local/java/jdk1.8.0_144/bin
After adding, run the following command to make the configuration effective
source /etc/profile
Use the command to check if there is version information, if there is information, it means the installation is complete
java -version
Reference article: CentOS uninstall openjdk and install jdk 1.8
Recommended Posts