How to install Java on Linux

Woowww, you are interested in Java programming and want to install it in Linux Platform??????Just follow these steps.

I have used Ubuntu in my case but you can use this tutorial to install Java on other Linux distros like Fedora, openSUSE etc.

  1. Visit Java downloads page here.
  2. Download the required version of Java(I recommend to download the version with .tar.gz extension. Filename like jdk-8u77-linux-x64.tar.gz)
  3. Extract the archive to your required location. (I have it in my home folder and folder name is jdk1.8.0_77)

Now that you have downloaded and extracted the file, lets set our environment variables and start using java.

To set your environment variables:

1)open your bashrc file .

run command gedit ~/.bashrc from terminal to edit bashrc file

2)Now add these lines in .bashrc file.

export JAVA_HOME=full path to your java directory(mine would be ~/jdk1.8.0_77)

export PATH=$JAVA_HOME/bin:$PATH

and save the file.

3)run command source ~/.bashrc from terminal

4)run command java -version to see if you have successfully installed java.

Please leave comments if you are having trouble installing Java.

Thanks for visiting my blog….cheers 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s