May 1, 2010 · 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.

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 Comments to “Howto install Sun Java Runtime Environment (JRE) in Ubuntu 10.04 (Lucid Lynx)”

  1. Nick Hanson says:

    Thanks, this works! I had a little problem, but its fixed now!

    [Reply]

  2. mesut says:

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

    [Reply]

  3. neeltje57 says:

    @mesut
    You must replace the double quotes with single quotes.

    [Reply]

  4. Brock says:

    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]

  5. Shurtugal says:

    Tanks a million..it worked

    [Reply]

  6. Whit says:

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

    [Reply]

  7. Digital says:

    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]

  8. Chris Barnes says:

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

    [Reply]

  9. Chris Barnes says:

    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]

  10. Drowzor says:

    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]

  11. Drowzor says:

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

    [Reply]

  12. shashank says:

    thanks man !

    [Reply]

  13. ricky says:

    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]

  14. ubuntugeezer says:

    just try the following command

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

    [Reply]

  15. Punxdelirium says:

    @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]

  16. javay says:

    thank you so much!!!

    [Reply]

  17. Robert says:

    after adding the new repo you need to update the apt database, i.e.

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

    sudo apt-get update

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

    [Reply]

  18. david says:

    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]

  19. david says:

    further to the above, looking at the ps listing, there is no “yesno” box arg to whiptail. hmmm.

    [Reply]

  20. david says:

    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]

  21. Trond says:

    David, try to press [tab], press [enter].

    [Reply]

  22. myth42 says:

    @Trond -thanks man, worked perfectly!!!!

    [Reply]

  23. sumesh says:

    when I typed in the terminal, it appears as follows
    sudo: add-apt-repositorydeb http://archive.canonical.com/ lucid partner: command not found

    [Reply]

  24. tony says:

    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]

  25. omm says:

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

    [Reply]

  26. ayos says:

    It work! i used a single quote. perfect, thanks man.

    [Reply]

  27. JZ says:

    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]

  28. ipog says:

    ipog@ubuntu: ~$: sudo add-apt-repository ‘deb http://archive.canonical.com/lucid partner’

    i’ve problem in this line, can any one help me to reover this……….whenever i enter this line it doesn’t response simply it return back ……..to this line below

    ipog@ubuntu: ~$:

    [Reply]

  29. Dave says:

    for me to get this to work i had to do:

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

    If you have troubles, give that a try

    [Reply]

  30. kambing says:

    It works, thanks
    here’re the lines of my sources.list file

    deb http://archive.canonical.com/ubuntu lucid partner

    deb http://kambing.ui.ac.id/ubuntu/ lucid main restricted universe multiverse

    You’ll meet dependecy problem if only use deb http://archive.canonical.com/ubuntu lucid partner in sources.list

    [Reply]

Leave a Reply