Install Java JDK on CentOS?

Java SDK

Install Java JDK (Java SE Development Kit)

Java JDK: Java bundle for software developers, incorporates a complete JRE in addition to apparatuses for creating, investigating, and observing Java applications..

First of all, attempt to see if you have the correct repository:

# yum search java | grep 'java-'

This is going to return all available packages that have java in the title. We are interested in the java- *, as the jdk will typically be in ‘java-version#’ type format, if you have to install a repository check Dag Wieers repository:

After you installed it, search again.

yum search java | grep 'java-'

now you’ll have a lot of java stuff.

Looking to the returned result, you can identify the most recent version:

java -1.7.0-openjdk.x86_64

so to install Java JDK on linux, it’s just a matter of applying the following command:

yum install java-1.7.0-openjdk.x86_64

You can check if Java JDK installed on your Linux OS by using the command:

whereis java

Check the sample outputs:

java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

To find the Java JDK version on Linux or Unix, Type the command following command:

java -version

Sample outputs:

java version "1.7.0_51"
OpenJDK Runtime Environment (rhel- u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
About This Author

I'm a software engineer with many years of experience, open source enthusiast, now I'm creating and contributing to awesome PHP web projects. I love coding as much as learning, and I enjoy trying new languages and patterns. My passion revolves around (but is not limited to) back-end development.

You are not signed in. Sign in to post comments.