How to Find Out if Java is Installed in Ubuntu and How to Install It

how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it photo 1

By default, Ubuntu does not come with Java (or the Java Runtime Environment, JRE) installed. However, you may need it for some programs or games like Minecraft. We will show you how to quickly and easily check if Java is installed and how to install it.

Note that Java can be vulnerable to security problems, and you should protect yourself. If you really need Java for programs or games that you run, read our article about protecting yourself from Java security problems.

NOTE: When we say to type something in this article and there are quotes around the text, DO NOT type the quotes, unless we specify otherwise.

To check which version, if any, of Java is installed, type the following at the prompt and press Enter.

java –version

If you get a result similar to the one shown in the following image, you do not have Java installed. The list shows you which packages in your system have Java available and the command for installing java is displayed.

However, before installing Java, let’s make sure all the packages are up to date. Type the following at the prompt and press Enter.

sudo apt-get update

This updates all the packages in available in Ubuntu. Type your password at the prompt and press Enter.

how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it photo 2

When the update is done, choose which a package from the list to install java. In our example, we installed version 6. Type the following command at the prompt and press Enter.

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

Replace the last part of the command after install with the package from the list that you chose.

how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it photo 3

Because you recently ran another command as root using sudo, you are not asked for your password again.

The progress of the installation displays and then a message displays saying how much disk space will be used. When asked if you want to continue, type a “y” and press Enter.

how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it photo 4

When the installation is done, check the version of Java again by typing “java –version” at the prompt and pressing Enter. You’ll see a result similar to the following indicating the version of Java you just installed.

how-to-find-out-if-java-is-installed-in-ubuntu-and-how-to-install-it photo 5

If you only need Java for desktop programs and games, it’s a good idea to disable Java browser integration. Again, see our article for instructions on how to do this.

Article How to Find Out if Java is Installed in Ubuntu and How to Install It compiled by Original article here

More stories

Network Security: General Security Tips for Windows Users

We have arrived at the final lesson in this How-To Geek School series. We have covered all the security tools that are built into Windows, and now we would like to some general tips that will improve the security of your computing experience.

How to Manage Startup Applications in Ubuntu 14.04

If you’ve installed a lot of applications in Ubuntu, you may have noticed that takes longer for your system to boot up. Some applications are automatically run when you boot up your Ubuntu system and this process uses up resources as Ubuntu boots.

Network Security: Beyond Defender: Third Party Security Products in Windows

While Microsoft tries to do a good job at providing a secure computing experience, there will always be other companies that provide better security products than those found in Windows. This is especially true when you consider Windows Defender (Microsoft Security Essentials) and its effectiveness