Install JDK on Ubuntu in 6 Steps

The Java Development Kit (JDK) is an implementation of either one of the Java Platform, Standard Edition, Java Platform, Enterprise Edition, or Java Platform, Micro Edition platforms released by Oracle Corporation in the form of a binary product aimed at Java developers on Solaris, Linux, macOS or Windows.The JDK includes a private JVM(Java Virtual Machine) and a few other resources to finish the development of a Java Application

We need JDK because it is a bundle of software components that is used to develop Java based applications and it includes JRE , the compilers and tools (like JavaDoc, and Java Debugger) to create and compile programs.

To install it on Ubuntu we need to follow some steps : –

Step 1-First of All we need to download JDK file using this link  (Don’t forget to Accept License Agreement) and Download bin.tar.gz file

Step 2– Now go to terminal (Ctrl + Alt + T) then go to where file is downloaded in my case

$ cd ~/Downloads/

Step 3– Now to extract use command

$ sudo tar xvzf jdk-10_linux-x64_bin.tar.gz -C /installDirectory

Step 4– Now we have to add Oracle JDK 10 to  PATH environment variable. Otherwise we will have to specify the full path when we run the Oracle JDK 10 commands.

To add Oracle JDK 10 to  PATH environment variable, we need to create a new file in /etc/profile.d with the following command:

so use any editor in my case i am using “nano”

$ sudo nano /etc/profile.d/

Step 5– Add following lines in (Don’t forget to enter your directory where you have installed JDK in place of installDirectory) after this press cntrl + X ( ^X ) then Enter y

export JAVA_HOME="installDirectory/jdk-10"
export PATH="$PATH:${JAVA_HOME}/bin"


Step 6– Now you have to restart your computer for the changes to take effect and to check JDK correctly installed use these commands

$ echo $JAVA_HOME
$ echo $PATH
$ java -version

That’s all these are the 6 steps to install JDK on Ubuntu

How to Install Ubuntu


Ubuntu is an open source operating system for computers. It is a Linux distribution based on the Debian architecture. It is usually run on personal computers, and is also popular on network servers, usually running the Ubuntu Server variant, with enterprise-class features. Ubuntu runs on the most popular architectures.

Things That Ubuntu Does Better Than Windows

1- Ubuntu is different. Everything is done via repositories and it uses a dedicated update manager to update both the operating system and all of the applications installed. So you only ever have to manage your updates from one place.

2-Ubuntu is also a lot less popular than Windows. That means that the bad guys who make all the viruses don’t really care about it, so they don’t bother writing much malware for Ubuntu: that’s great news for us users!

3-Desktop customization is also cool in Ubuntu there are several themes available over the internet

4-We can also use as a live environment

5-Ubuntu is 100% free. It won’t cost you a penny (although you can make a donation on their download page)

Bootable pen drive for ubuntu ?

Firstly visit above link and download ubuntu ISO file and make bootable pen-drive ( U can use softwares like powerISO ,unetbootin and in ubuntu u can use Startup disk creater) Now there are two options if u wants to use as a live environment then TRY UBUNTU option otherwise INSTALL UBUNTU

Use something else if u wants to customize partitions then click on install now button after that

Swap Area ( Linux-swap)

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM.

For more modern systems (>1GB), your swap space should be at a minimum be equal to your physical memory (RAM) size “if you use hibernation”, otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM

Now proceed according to instructions . . .

Finally Ubuntu is installed on your system