In general, Linux systems have their own JDK, but do not meet development requirements, so you need to uninstall, reinstall the JDK
Step 1: View the JDK version of an existing installation
Command:
Rpm-qa | Grep-i Java
Step 2: Uninstall the existing software
Command:
RPM-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.e16.i686
RPM-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.e16.i686
Step 3: Unzip the JDK
Command:
TAR-ZXVF jdk-8u151-linux-i586.tar.gz
Step 4: Move the JDK to "/usr/local/src/java" and rename
Command:
MV jdk1.8.0_151/usr/local/src/java/jdk1.8
Step 5: Configure the system environment variables
Command:
Vim/etc/profile
To add related variables in the configuration file:
Export java_home=/usr/local/src/java/jdk1.8
Export path= $JAVA _home/bin: $PATH
Step 6: Make the configuration file effective and test
Command:
Source/etc/profile
Java-version
Javac
Complete!!!!!
Installing the JDK under the Centos-linux system