How to Install JDK in Linux using YUM


We can install Java using YUM command and also using RPM commands for Linux OS.

Lets see about installation of JDK using YUM.


In the Shell prompt, issue the command – # yum search jdk.

This will load all the JDK related packages with versions which are available to the configured rpm file.

# yum search jdk
Loaded plugins: priorities, update-motd, upgrade-helper
N/S matched: jdk ==========================================================
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
ldapjdk-javadoc.noarch : Javadoc for ldapjdk
ldapjdk.noarch : The Mozilla LDAP Java SDK

Name and summary matches only, use "search all" for everything.

Now select the required packages for installation of Java, we are choosing install java-1.7.0-openjdk-devel.x86_64 & java-1.7.0-openjdk.x86_64

# yum install java-1.7.0-openjdk-devel.x86_64 java-1.7.0-openjdk.x86_64
Loaded plugins: priorities, update-motd, upgrade-helper
Package 1:java-1.7.0-openjdk- already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk-devel.x86_64 1: will be installed
--> Finished Dependency Resolution
Dependencies Resolved
Package Arch Version Repository Size
java-1.7.0-openjdk-devel x86_64 1: amzn-updates 11 M
Transaction Summary
Install 1 Package
Total download size: 11 M
Installed size: 36 M
Is this ok [y/d/N]: y
Downloading packages:
java-1.7.0-openjdk-devel- | 11 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:java-1.7.0-openjdk-devel- 1/1
Verifying : 1:java-1.7.0-openjdk-devel- 1/1
java-1.7.0-openjdk-devel.x86_64 1:

Next We will see about Installation of Java using RPM Method

One Comments

  • GalaPFacer

    March 7, 2016

    Hey there just wanted to give you a quick heads up and let you know a
    few of the pictures aren’t loading properly.
    I’m not sure why but I think its a linking issue. I’ve tried it in two different browsers and both show
    the same outcome.

Leave a Reply