Howto install Sun Java Runtime Environment (JRE) in Ubuntu 10.04 (Lucid Lynx)

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.

We have already posted about sun java was moved to the Partner repository in Ubuntu 10.04 (Lucid)

Procedure to follow

Open terminal and run the following commands

Add partner repository using the following command

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

Update the source list

sudo apt-get update

Now install sun java packages using the following commands

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

The above command will download all the required 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

Sponsored Link

Incoming search terms:

Related posts

127 thoughts on “Howto install Sun Java Runtime Environment (JRE) in Ubuntu 10.04 (Lucid Lynx)

  1. Error: need a repository as argument
    after using the first line command this error occured.any help?

    [Reply]

  2. Is it just me or did your post end prematurely? I believe you were going to suggest opening Firefox and typing “about:plugins” in the browser bar to make sure that Java shows up? Thanks for the how-to. Worked great for me.

    [Reply]

  3. … or replace the left double quote with the one on your keyboard – it got converted to the typographic version here.

    [Reply]

  4. ok so i follow those commands and this comes up: barrito@barrito-laptop:~$ 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

    what do i do

    [Reply]

  5. I got the exact same results as “Digital”. I am in kind of a bind as I need this kind of urgently…

    [Reply]

  6. Ok – Whit’s suggestion was what was needed. Replacing the double quotes in the add-apt-repository command with single quote marks allowed this to work.

    [Reply]

  7. Er, well, I didn’t know it required single quotes until it wasn’t working and I scrolled down. I’ve added it with single quotes now which has worked but it’s screwed my source.list.

    Any idea how to fix this? >.>

    [Reply]

  8. Whit’s suggestion will probably work for me… only I have no idea how to open and edit the file D:

    [Reply]

  9. I get this message when I try to follow the prompts. Any suggestions?

    ricky@ricky-laptop:~$ 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
    ricky@ricky-laptop:~$

    [Reply]

  10. @Drowzor,

    To open the file i suggest you use gedit, if you are new. So go to your terminal and type:

    sudo gedit /etc/apt/sources.list

    Go to the bottom of the list and delete / edit the one you added. And that should fix your error

    [Reply]

  11. all of the above makes sense and I get to the point of seeing the DLJ window listing licensing terms. however there is no selection! there is a process “whiptail” with the entire text of the DLJ. but no dialogue box appears, nor is there a place to make a selection. this is on ubuntu 10.04.1 LTS

    [Reply]

  12. ok, more info – whiptail uses msgbox and there is indeed an “button” and normally one would hit and whiptail would exit and allow the calling script to continue. only it doesn’t! :-)

    whiptail ignores all keyboard, it seems, including

    [Reply]

  13. an error comes up when ever i do saying
    sudo apt-get install sun-java6-jre sun-java6-plugin
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    The following packages were automatically installed and are no longer required:
    linux-headers-2.6.32-16 linux-headers-2.6.32-16-generic
    Use ‘apt-get autoremove’ to remove them.
    The following extra packages will be installed:
    gsfonts-x11 odbcinst odbcinst1debian1 sun-java6-bin unixodbc
    Suggested packages:
    sun-java6-fonts ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho
    ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql tdsodbc
    unixodbc-bin
    The following NEW packages will be installed:
    gsfonts-x11 odbcinst odbcinst1debian1 sun-java6-bin sun-java6-jre
    sun-java6-plugin unixodbc
    0 upgraded, 7 newly installed, 0 to remove and 6 not upgraded.
    E: Could not get lock /var/cache/apt/archives/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock the download directory

    [Reply]

  14. @tony: make sure you don’t have a package manager open (synaptic/kpackagekit,…) or another apt-get session open in a different console

    [Reply]

  15. After running
    sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

    I get this:
    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.22-0ubuntu1~10.04) but it is not going to be installed or
    ia32-sun-java6-bin (>= 6.22-0ubuntu1~10.04) but it is not installable
    Recommends: gsfonts-x11 but it is not going to be installed
    sun-java6-plugin: Depends: sun-java6-bin (>= 6.22-0ubuntu1~10.04) but it is not going to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

    I tried following the instructions by running
    apt-get -f install

    But then I get this
    E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied)
    E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

    [Reply]

Leave a comment

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