How to install java development kit(JDK) on Ubuntu ?

This tutorial is  for the beginner who wants to install jdk in their Linux operating system.The Java Development Kit (JDK) is a software development environment  for developing Java applications and applets. Furthermore,It includes the Java Runtime Environment (JRE), an interpreter (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc) and other tools needed in Java development.

Here are the steps to install java development kit.

Step 1:

Download jdk tar file of your required version(1.7,1.8)from the oracle website: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Step 2:

After that, untar tar file using command tar -xvzf <tar file name>. As as result, you will get log and information in terminal as shown in figure below.

Step 3:

Edit a .bashrc file located in home directory in your system. After that set up JDK path with the location of untar file from above step as below:

export JAVA_HOME=/opt/jdk1.8.0_221 ( this is the path of your jdk location extracted from tar file)
export PATH=$JAVA_HOME/bin:$PATH

Step 4:

Then save the .bashrc file and enter the command bash.  After that open new linux terminal tab and enter the command java -version.  Finally, check your JDK information using command ‘java -version’ as shown in below figure.

In conclusion, you need JDK to install other different software and tools in Ubuntu. For instance, Hadoop, Spark and so on,

About sgc908

Graduate Research Assistant at North Dakota State University, Precision Agriculture, Machine Learning, Deep Learning and Big Data.

View all posts by sgc908 →