JDK & JRE Easy Installation Steps for Ubuntu

Step 1- Open the terminal window by CTRL+ALT+T. Install the default JDK by the following command

and press enter.

Wait for the file to completely install, when it shows done then move to the next step.


Step 2- Now install the default JRE file using terminal window by the following command

and wait for the file to install.


Step 3- Now download the JDK file from the following link:



Step 4- Download the JRE file from the following link:




Step 5- After the file is downloaded in the download folder open the terminal window and run:

It will ask for the administration permission and you have to enter your system password in it, as you’ll press enter a new window will open.



Step 6- Now open Computer->Home->Downloads->Your downloaded JDK file: “jdk-8u131-linux-x64.tar.gz”->right click on this file->Open this file with Archive Manager->Extract the file in Computers/usr/ java

Repeat the same steps to extract JRE file.

Computer->Home->Downloads->Your downloaded JRE file: “jre-8u131-linux-x64.tar.gz”->right click on this file->Open this file with Archive Manager->Extract the file in Computers/usr/ java


Step 7- Once the file is extracted open the Terminal Window by using Ctrl+Alt+T.



Step 8- Open the terminal and run the following command :

and press Enter, it will ask for the system password, enter the password and wait for sometime. It will update all the latest packages installed on your system.




Step-9 After the package lists reading is done, double-check your directories at this point, you should have an uncompressed binary directory in /usr//java for the Java JDK/JRE,

Type the following command to change the directory:

Type the following command to view the list of folders inside the directory:




Step-10 Once the directories are checked now it’s time to install the JDK file. Type the following command in the terminal window:

Then it will ask you to enter your system password, as you input the password press enter.



You will see an editor will open:



Step 11- Type the following commands in the editor:


Save the file by pressing CTRL+S and close the window.


Step-12 Reload the file by typing the following command: 




Step 13- Now type:

and enter the following path in the editor at the bottom of the page and save the file by CTRL+S or by pressing SAVE button on the top right corner and close the editor window

Path to enter in the file:





Step 14- Now type the following command to reload the file:

Check the expected results by typing following commands:

It must display  “//usr/java/jdk1.8.0_131” and “/usr/java/jre1.8.0_131” respectively.

Step 15- Now smile, your JDK and JRE files are now installed in your system.

Check your files by typing  

in the terminal window.

If you get this as a result:

java version “1.8.0_131”

Java(TM) SE Runtime Environment (build 1.8.0_131-b11)

Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

then you have got all right and your files are successfully installed.

*****************************THANK YOU ***********************