How to Check If Java Is Installed on Ubuntu (And Install If It Isn’t)

Joel Lee 09-01-2017

Despite the fact that Java can be problematic 12 Unnecessary Windows Programs and Apps You Should Uninstall Wondering which Windows 10 apps to uninstall? Here are several unnecessary Windows 10 apps and programs you should remove. Read More , it’s often times a necessary evil. A lot of cross-platform apps are written in Java, and considering how Linux already lacks a lot of useful apps Why We Never Had "The Year of the Linux Desktop" Linux users have been praying for the "Year of the Linux desktop". But if we're ever going to see Linux gain serious traction, there is much that Linux developers need to improve. Read More , choosing not to use Java will severely limit your options.


Not sure if Java is installed on your system? Most fresh installations of Ubuntu (and other Ubuntu-based distros) do not have Java installed by default, so if you’ve never installed it before, you probably don’t have it. But to be sure, open Terminal and run this command:

java -version

If it works, you’ll see which version of Java is installed along with some other details that may or may not be useful. If the command isn’t recognized, then Java isn’t on your system.

Installing Java is simple. First you’ll want to update your package and repository information to avoid out-of-date installs and the like:

sudo apt-get update

Once that’s done, you can install Java with this command:

sudo apt-get install default-jre

JRE stands for Java Runtime Environment. It’s all you’ll need to run Java apps on your system. The JDK, or Java Development Kit, is only necessary for programmers who are creating Java apps.


There are actually multiple versions of Java available to Linux users. The above command will install the latest available version of OpenJDK’s JRE, which is the version we recommend. If the above command doesn’t work, you can try this instead:

sudo apt-get install openjdk-8-jre

It may take a while depending on how slow your system is, but that’s about it. Once it’s done, Java will be ready to use and you’ll be able to install and play Minecraft on Linux How to Install and Optimize Minecraft on Linux: 8 Key Steps Playing Minecraft on Linux? If you've run into performance issues, use these Minecraft optimization tips for the best experience. Read More , for example.

What do you need Java for? Could you live without it? Let us know in the comments below!

Related topics: Java, Ubuntu.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Doc
    January 9, 2017 at 4:28 pm

    As Java is one of the most hated (second only to Adobe Flash) plugins among security gurus, what's the point of having it installed? I've found it to be slow, buggy, and riddled with security holes. I've requested all my users uninstall it (I'm the tech department for a SMB), and the only use I've found for it is for preflighting eBooks (and I've stopped using it for that!)