1. View the available JDK versions
After the login server is successful, enter the following command to view the supported JDK versions
Yum-y List java*
Because the server version is 64-bit, I would like to install 1.8 jdk, so select the marked version, to install;
PS: with-devel installed is the JDK, without-devel, actually installed is jre!
2. Installing the JDK
Enter the following command to wait for the installation to complete:
Yum Install-y java-1.8.0-openjdk-devel.i686
4. Verifying the installation results
Enter the command:
[Email protected] ~]# java-version
The presence of this information indicates that the JDK installation was successful.
5. View JDK Version information
If you want to view the installation information for the JDK, you can enter the following command to view:
Cd/usr/lib/jvm
Go to the installation directory and enter the following command:
Ls
5. Configure the default JDK version
If you have several different versions of the JDK installed, you can view the installed JDK with the following command:
Update-alternatives--config Java
The display interface is as follows:
If you want to keep the current version "*" Unchanged, press ENTER to select a different version, please enter the number.
Linux installation JDK