How to Install Oracle Java JRE on Ubuntu Linux

This wikiHow teaches you how to install the Java Runtime Environment (JRE) on a computer running Ubuntu Linux. While the most common way to install the JRE is by installing the Java Development Kit (JDK)—which installs the JRE by d...

Method 1 of 2:

Using Terminal

  1. Picture 1 of How to Install Oracle Java JRE on Ubuntu Linux
    Open Terminal. Click the Terminal app icon, which resembles a black box, in the bar on the left side of the screen.
    1. You can also press Alt+Ctrl+T to bring up the Terminal window.
  2. Picture 2 of How to Install Oracle Java JRE on Ubuntu Linux
    Enter the Java install command. Type in sudo apt install jre and press Enter. This command prompts Linux to begin searching for the JRE installation site.
  3. Picture 3 of How to Install Oracle Java JRE on Ubuntu Linux
    Enter your password when prompted. Type in the password you use to log into your computer, then press Enter. The installation will commence.
  4. Picture 4 of How to Install Oracle Java JRE on Ubuntu Linux
    Allow the JRE files to install. This will take a few minutes. When you see the terms of use prompt appear, you may proceed.
  5. Picture 5 of How to Install Oracle Java JRE on Ubuntu Linux
    Select when prompted. Press the left arrow key, then press Enter. Java will resume installing.
  6. Picture 6 of How to Install Oracle Java JRE on Ubuntu Linux
    Wait for Java to finish installing. Once you see your username appear at the bottom of Terminal, you can continue.
  7. Picture 7 of How to Install Oracle Java JRE on Ubuntu Linux
    Check your Java version. Type in java -version and press Enter, then wait for the Java version number to appear.
    1. If doing this results in an error, Java didn't install correctly. You may need to try installing it manually.
  8. Picture 8 of How to Install Oracle Java JRE on Ubuntu Linux
    Remove unnecessary files. You can get rid of temporary files installed by Java by doing the following:
    1. Type in sudo apt autoremove and press Enter.
    2. Type in y and press Enter.
Method 2 of 2:

Installing Java Manually

  1. Picture 9 of How to Install Oracle Java JRE on Ubuntu Linux
    Open the Java download site. Go to https://java.com/download in your computer's web browser.
  2. Picture 10 of How to Install Oracle Java JRE on Ubuntu Linux
    Click Free Java Download. It's a red button in the middle of the page. Doing so opens the Downloads page.
  3. Picture 11 of How to Install Oracle Java JRE on Ubuntu Linux
    Click the Linux link. This option is near the middle of the page. Clicking it should prompt the Java folder to begin downloading.
    1. You may first have to click Save to prompt the download to begin.
  4. Picture 12 of How to Install Oracle Java JRE on Ubuntu Linux
    Open the "Downloads" folder. Click the Files app icon—which resembles a grey filing cabinet drawer on the left side of the screen—then double-click the "Downloads" folder.
  5. Picture 13 of How to Install Oracle Java JRE on Ubuntu Linux
    Extract the downloaded folder. Right-click the "jre-#####-linux" folder, then click Extract Here in the resulting drop-down menu. You should see a new, regular folder with a similar name appear in the "Downloads" folder.
  6. Picture 14 of How to Install Oracle Java JRE on Ubuntu Linux
    Move the extracted folder if necessary. If you want to install Java in a location other than the "Downloads" folder, do the following:
    1. Click once the extracted folder to select it.
    2. Press Ctrl+X to cut the folder.
    3. Go to the folder you want to use as an installation location and open it.
    4. Press Ctrl+V to paste in the extracted Java folder.
  7. Picture 15 of How to Install Oracle Java JRE on Ubuntu Linux
    Find the extracted folder's "bin" folder. Open the extracted folder, then double-click the folder with the Java version number as its name. This will open the Java folder; you should see a folder entitled "bin" here.
  8. Picture 16 of How to Install Oracle Java JRE on Ubuntu Linux
    Find the "bin" folder's path. To do so:
    1. Right-click the "bin" folder.
    2. Click Properties.
    3. Expand the "Properties" window by clicking and dragging right its right side until the entire "Location" path is visible.
    4. Select the "Location" path by clicking and dragging your mouse across it.
    5. Press Ctrl+C to copy the path.
  9. Picture 17 of How to Install Oracle Java JRE on Ubuntu Linux
    Open the ".profile" document. The easiest way to do this is through Terminal:
    1. Open Terminal.
    2. Type in gedit .profile and press Enter.
  10. Picture 18 of How to Install Oracle Java JRE on Ubuntu Linux
    Create a new line at the bottom of the document. Scroll all the way down to the bottom of the document, then click below the bottom text entry.
  11. Picture 19 of How to Install Oracle Java JRE on Ubuntu Linux
    Enter the Java "Home" path. The home path is the line export JAVA_HOME=/path where "/path" refers to the path you copied from the "bin" folder; you can paste in the copied path by pressing Ctrl+V. Your end result should resemble something like the following:[1]
    1. export JAVA_HOME=/home/name/java/jre1.8.0_181
  12. Picture 20 of How to Install Oracle Java JRE on Ubuntu Linux
    Press Enter to create a new line. This new line should be directly beneath the "export JAVA_HOME=" line.
  13. Picture 21 of How to Install Oracle Java JRE on Ubuntu Linux
    Specify the PATH variable. Type in PATH="$PATH:$JAVA_HOME/bin" and then press Enter.
  14. Picture 22 of How to Install Oracle Java JRE on Ubuntu Linux
    Click Save. It's in the top-right corner of the window. Doing so saves your changes to the ".profile" document.
  15. Picture 23 of How to Install Oracle Java JRE on Ubuntu Linux
    Restart your computer. This will apply your changes, thus installing Java:
    1. Click
      Picture 24 of How to Install Oracle Java JRE on Ubuntu Linux
      in the top-right corner of the screen.
    2. Click
      Picture 25 of How to Install Oracle Java JRE on Ubuntu Linux
      in the resulting drop-down menu.
    3. Click Restart when prompted.
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile