Java Linux

Java is one among many programming languages that is widely used in different applications and websites. If Java is not installed, some applications or websites might not work. It possesses a website plugin that permits an individual to run apps based on Java in a web browser.

Java is preferred because it is quick, safe and dependable. Ubuntu is a type of operating system that was initially meant mainly for personal computer until recently where it can also be used in servers. It usually includes a variation of applications including word processing, web server application, e-mail applications and other programming tools .

But how does do you install Java apps and programs on Ubuntu? The following tips are necessary for for you to successfully install Java a program or app on Ubuntu.

1st Step.

You need to check if your Ubuntu operating system is 32-bit or 64-bit. To do it, open a terminal window and run the following command:


You will note that the Ubuntu operating system will show whether it is 32-bit or 64-bit operating system.

2nd Step.

Check if there is a previous installation of Java on your Ubuntu system. This is done by running java version command also from terminal.

Go to the terminal and type the command below.

java version

If Java Development Kit (JDK) is installed on your computer it may appear as shown below:

Java version “1.X.X_XX”

3rd Step.

If you have an older version of Java, you will have to remove it. To remove an installed app/program/package, read the following tutorial:

How to Uninstall in Linux a Software or a Package Using the Command Line

Now, you have to download Oracle Java Binary. Choose the system architecture whether it is 32-bit or 64-bit operating system.

Then copy the Oracle binaries and unpack in the directory into the usr/local/java directory. The download should be in the following folder: /home/”your_user_name”/downloads/

Make sure that you have uncompressed binary in /usr/local/java for JDK/JRE java

Then create a system path file /etc/profile with any text editor like Nano, Gedit or any other.

If you already have file profile go to the end of the file save the /etc/profilefile and exit.

Load the system path/etc/profile using the following command from terminal:


4th Step.

You have to notify the Ubuntu that the java application must be set as default for JRE. Open the terminal and write the following command:

sudo update-alternatives—set javaws/usr/local/java/jre1.7.0_45/bins/javaws

This is the command to set java web. Now load again the system path/etc/profile using the following command from terminal:


Now check for the Java version from the terminal and if you have done the step correct, it will show the version.

java version

Now when you have Java installed, you will be able to run any Java program on your Ubuntu. If this article was helpful for you, please share with your friends.

Leave a Reply