Friday, April 5, 2013

Find If Java Is Installed In Ubuntu. If Not, How To Install Java In Ubuntu

It is difficult to survive in today’s technical world without using Java. Ubuntu by default does not come with Java Runtime Environment (JRE) installed in  it. At a certain point, you may need to use Java to run some application, web browser plugins or to open jar files. And at that particular moment you may start thinking if you have Java installed in Ubuntu?

Find if Java is installed in Ubuntu:

Open the terminal (Ctrl+Alt+T) and run the following command (which can be read as java space hyphen version):
java -version
If you see an output like this, it mean Java is not installed in your Ubuntu machine:
takshak@takshak-desktop:~$ java -version
The program ‘java’ can be found in the following packages:
* default-jre
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
* gcj-4.5-jre-headless
* openjdk-7-jre-headless
Try: sudo apt-get install

Install Java in Ubuntu:

So, you found that Java is not installed in your Ubuntu. Now what? Well.. as you can see in the above output, Ubuntu has already answer your question. You can use any of the above mentioned packages to install java in your Ubuntu system. Lets say you want to install Java 6. Use the following command in the terminal:

sudo apt-get install openjdk-6-jre-headless

That is it. You don’t need to do anything more than this. You have powered Ubuntu with Java.

No comments:

Post a Comment