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

Related posts

You may also like...

153 Responses

  1. Chris says:

    Try this – go to , click “Do I have Java?”, Firefox will say you are missing a plugin, let it install Java. Done!

  2. Titus says:

    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 [email protected]

  3. admin says:

    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

  4. Bob says:

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

  5. Prasadh says:

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

  6. I tried installing sun-java6 on ubuntu 9.04 (for runescape) but didn’t work…
    any suggestions???

  7. a sandwhich says:

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

  8. Alex says:

    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!

  9. Alex says:

    Just checked. Something is wrong with my Java too. Going to investigate.

  10. sassy says:

    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!!!

  11. Maurizio says:

    Works perfect! thank you.

  12. Tiffany Argenti says:

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

  13. Ali Merlette says:

    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

  14. Rick says:

    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

  15. Mick says:

    Rick just press TAB – key
    and then enter key

  16. neltha says:

    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.

  17. venkatesh says:

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

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

    [email protected]:/# 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

  19. maina says:

    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?

  20. Dass says:

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

  21. Kael says:

    Same as Tom Todhunter:

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

  22. dove1of7 says:

    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.

  23. Craig Skelton says:

    sudo add-apt-repository “deb lucid partner”

    Will enable the partner repo and allow you to install the jdk via

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

  24. Muddle says:

    I’m having exactly the same problem as Tom Todhunter
    Please advise

  25. Ekman says:

    If I do: sudo add-apt-repository “deb lucid partner”

    I get: Error: need a repository as argument

    Have I missed something?

  26. Mike says:

    Don’t forget the apt-get update after adding the new repository.

  27. Matt says:

    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.

  28. Mehta says:

    Matt’s answer worked for me. Thank’s Matt.

  29. A.chaudhary says:

    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 Reply

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