April 15, 2007 · General · Email This Post

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 Comments to “How to Install Java Runtime Environment (JRE) in Ubuntu”

  1. Chris says:

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

    [Reply]

  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 titus.gitau@gmail.[email protected]

    [Reply]

    admin Reply:

    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

    [Reply]

  3. Bob says:

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

    [Reply]

  4. Prasadh says:

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

    [Reply]

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

    [Reply]

  6. 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?

    [Reply]

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

    [Reply]

  8. Alex says:

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

    [Reply]

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

    [Reply]

  10. Maurizio says:

    Works perfect! thank you.

    [Reply]

  11. Tiffany Argenti says:

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

    [Reply]

  12. 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

    [Reply]

  13. 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

    [Reply]

  14. Mick says:

    Rick just press TAB – key
    and then enter key

    [Reply]

  15. 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.

    [Reply]

  16. venkatesh says:

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

    [Reply]

  17. 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

    [Reply]

  18. 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?

    [Reply]

  19. Dass says:

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

    [Reply]

  20. Kael says:

    Same as Tom Todhunter:

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

    [Reply]

  21. 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.

    [Reply]

    admin Reply:

    If you are running ubuntu 10.04 try this http://www.ubuntugeek.com/how-install-sun-java-runtime-environment-jre-in-ubuntu-10-04-lucid-lynx.html

    [Reply]

  22. Craig Skelton says:

    sudo add-apt-repository “deb http://archive.canonical.com/ 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

    [Reply]

  23. Muddle says:

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

    [Reply]

  24. Ekman says:

    If I do: sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”

    I get: Error: need a repository as argument

    Have I missed something?

    [Reply]

  25. Mike says:

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

    [Reply]

  26. 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.

    [Reply]

  27. Mehta says:

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

    [Reply]

  28. 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).

    [Reply]

  29. Daniel says:

    Hi ya’ll this site has been really useful. Feel I’m getting more understanding here then other Ubuntu forums dealing with Ubuntu 10.04 and Pogo.

    I ran the commands lines like posters have said, made the necessary corrections.

    And this is my version of java, when run the java -version command.

    java version “1.6.0_18″
    OpenJDK Runtime Environment (IcedTea6 1.8) (6b18-1.8-0ubuntu1)
    OpenJDK Client VM (build 14.0-b16, mixed mode, sharing)

    AND

    my firefox plugin for java
    appears to still be using IceTea

    Still new to Ubuntu, it may be different but I am liking it.

    [Reply]

  30. cin_verd says:

    Matt’s answer worked for me as well, as I was getting error messages trying to use the console. Thanks!

    [Reply]

Leave a Reply