How to Install Java Runtime Environment (JRE) in Ubuntu

Sponsored Link
Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. Java applications are compiled to bytecode, which at runtime is either interpreted or compiled to native machine code for execution.

The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.

Currently Ubuntu has the following Java packages

sun-java6-bin -- Contains the binaries

sun-java6-demo -- Contains demos and examples

sun-java6-doc -- Contains the documentation

sun-java6-fonts -- Contains the Lucida TrueType fonts from the JRE

sun-java6-jdk -- Contains the metapackage for the JDK

sun-java6-jre -- Contains the metapackage for the JRE

sun-java6-plugin -- Contains the plug-in for Mozilla-based browsers

sun-java6-source -- Contains source files for the JDK

Installing the Java Runtime Environment

First you need to check multiverse repository enabled or not after that open a terminal window. Since you are going to be installing the JRE and the web browser plug-in, you'll be using the following command from a terminal

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

Once it downloads the packages and begins the installation, you'll get a screen that contains the Sun Operating System Distributor License for Java and hit Enter to continue. You'll see a dialog that asks you if you agree with the DLJ license terms. Select Yes, and hit Enter; the JRE will finish installing.

Testing Java Runtime Environment

You'll want to confirm that your system is configured properly for Sun's JRE. This is a two-step process.

First, check that the JRE is properly installed by running the following command from a terminal.

java -version

You should get similar output

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)
Testing Java Plugin for Firefox

open Firefox and typing about:plugins in the address bar and check for java plugin

Sponsored Link

Incoming search terms:

Related posts

153 thoughts on “How to Install Java Runtime Environment (JRE) in Ubuntu

  1. I am new in Ubuntu 7.10. However I want to Install Java Runtime Environment so as to install cafepilot software. I down loaded jre-6u16-linux-i586.bin self extracting. But I have been unable to install.
    At least I know that I have to go to the root so I type sudo -i
    and I put there the password. Please help me out step by step
    Thank you
    my email address is

  2. Try to install the following packages

    sudo aptitude install sun-java6-jre sun-java6-plugin sun-java6-fonts

    Make sure you have enabled universe,multiverse repositories

  3. Thanks! Much more helpful than what I found with numerous other Google searches. Appreciated!

  4. this link helped me to resolve the Java plugin problem in Ubuntu 9.0.4 version with firefox. Thanks to the owner.

  5. Hey,iv installed bothe 5 and 6 of the jre and jdk and i still can’t run dr java. Any suggestions?

  6. Alex .G., I also tried to install JRE for Runescape amongst other several reasons. You should download Ubuntu 9.10 and install it, although you could have issues with your WiFi. It worked fine for me on Karmic (9.10). Hope I could help you!

  7. okay so I have ubuntu on my computer great i type in what has been suggested it started then stops and says can’t find. so I go the java website listed do what it says do i have linux 6 u-i586.bin on my computer will not open and the terminal will not recognize it. so now what do i do? i’m to the point i will let you do the work remotely if you like because i’m pretty good on computers but i don’t know about this program thought it was suppose to easy but you can’t doin anything because you can’t the damn thang to work right. PLEASE PLEASE PLEASE HELP ME!!!

  8. Wow, that’s a thought-provoker How to Install Java Runtime Environment (JRE) in Ubuntu | Ubuntu Geek! Tiffany Argenti

  9. Hi, I found this post while searching for help with JavaScript. I’ve recently switched browsers from Google Chrome to IE. Just recently I seem to have a issue with loading JavaScript. Everytime I go on a site that requires Javascript, my computer freezes and I get a “runtime error javascript.JSException: Unknown name”. I cannot seem to find out how to fix the problem. Any aid is greatly appreciated! Thanks

  10. I tried installing it with the directions but after i get the licenses and stuff and gives me i cannot get it to proceed by pressing enter

  11. Can someone please give me step by step instructions on how to install cafepilot on my computers. I am running ubuntu latest version. I am very new in Ubuntu environment.

  12. oracae 10g is not installed on my system western language suppored now please help me

  13. I get the following response when I attempt to follow these instructions.

    root@ubuntu:/# sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package sun-java6-jre is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package sun-java6-jre has no installation candidate

  14. How can I update from Ubuntu 9.10 Karmic Koala (which am currently using) to Ubuntu 10.04 Lucid Lynx off-line just using the CD image and retain my documents?

  15. If you install it on the old partition, deleting the old OS (9.10), all your old files will be deleted, unfortunately.

  16. Same as Tom Todhunter:

    E: Package sun-java6-jre has no installation candidate

  17. I’m so tiried of pogo not letting me play my games .I don’t know if its pogo or java .But I pay for pogo please help me.Its just not fair.

  18. Here’s a FAR SIMPLER solution if you are running a GUI version of Ubuntu:

    (1) go to System / Administration / Synaptic Package Manager
    (2) Inside the Package Manager choose Settings / Repositories
    (3) Click the tab for “Other Software”
    (4) Select “ubuntu lucid partner” – this will likely be the first option
    (5) Close the Settings windows then click “Reload” in the main Package Manager window.
    (6) Type “jre” into the search field and press enter
    (7) Select the jre in the list of results, be sure to choose “Mark for Installation”
    (8) Click the “Apply” button.

    This worked for me. It’s more steps than using the command line, but it’s much simpler.

  19. hwen I tried to instal I got this msg. plese help me to solve the issue.
    sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    You might want to run `apt-get -f install’ to correct these:
    The following packages have unmet dependencies:
    sun-java6-jre: Depends: sun-java6-bin (>= 6.20dlj-1ubuntu3) but it is not going to be installed or
    ia32-sun-java6-bin (>= 6.20dlj-1ubuntu3) but it is not installable
    Recommends: gsfonts-x11 but it is not going to be installed
    sun-java6-plugin: Depends: sun-java6-bin (>= 6.20dlj-1ubuntu3) but it is not going to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

Leave a comment

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