CentOS Install Java SDK using yum Command
To install the Java SDK on a CentOS system using the yum command, follow these steps:
- Import the Oracle GPG key by running the following command:
sudo rpm --import https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7- Create a file called
/etc/yum.repos.d/java.repowith the following content:
nname=Oracle Linux $releasever Developer (EPEL)
nbaseurl=http://yum.oracle.com/repo/OracleLinux/OL7/developer/EPEL/x86_64/
ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
ngpgcheck=1
nenabled=1- Update the package index by running
sudo yum update. - Install the Java SDK by running the following command:
sudo yum install java-1.8.0-openjdk- Verify the installation by checking the version of Java installed by running the following command:
java -versionThat’s it! You have successfully installed the Java SDK on your CentOS system using the yum command.
