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. ramesh says:

    Thanks for this tip. It was really helpful. With the single quotes it worked like a charm.

    [Reply]

  2. John R says:

    Thanks to ramesh for his comment, worked great with the single quotes! Had trouble selecting Ok for license agreement to continue, by clicking right hand arrow key, I was able to select it and hit enter and then the install finished okay. Then select SUN Microsystems Inc. version 1.6.0_22 in OO Base, Tools, Options, to update Java. Thanks!

    [Reply]

  3. WIlliam says:

    whenever i run sudo apt-get update it tells me

    E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
    E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

    [Reply]

  4. @william: you need to close or stop other software managers(eg:synaptic packet manager).

    [Reply]

  5. Seerak says:

    sudo: add-apt-repository: command not found.

    New 10.04 Ubuntu Server setup (command line only).

    Solution:

    sudo apt-get install python-software-properties

    Oddly, the system only told me this when I tried running add-apt-repository without sudo. With sudo, it just failed unhelpfully. I guess the system assumes that someone who knows enough to use sudo doesn’t need any help :P

    [Reply]

  6. Seerak says:

    OK, after hosing my sources.list and fixing it, I get this error:

    “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.”

    I get this with both the repository path cited here, and the variant “ubuntu lucid partner” mentioned in comments on another post here, as well as with one or the other commented out.

    [Reply]

  7. Seerak says:

    And now after all that, I find that the previous hosing seems to have interfered with with apt-get update. I ran that again with the verified clean sources.list, and now it works.

    I hope these three comments can help someone else with fat fingers :P

    [Reply]

  8. Christine says:

    Help when I run the command it tells me this:
    E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

    [Reply]

  9. Christine says:

    Whenever I try to run the command:
    sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”

    Then it says:E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

    How can I fix this?

    [Reply]

  10. Rudolf says:

    Many thanks!

    [Reply]

  11. bob fucking dole says:

    SUDO APT-GET UPDATE

    DO IT AGAIN BEFORE WHINGING ABOUT NOT FOUND ERRORS

    THIS IS LINUXXXX

    [Reply]

  12. Joel says:

    I ran “sudo apt-get update”, and then “sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts”, it still get this error:
    E: Package sun-java6-jre has no installation candidate

    Hmmm…

    [Reply]

  13. chandra sekar says:

    Its very usefull for me.

    [Reply]

  14. wal id says:

    worked perfect thanx

    [Reply]

  15. Maverick says:

    all installation finished .. but i can’t press enter to accept the agreement . Though restarted even java -version or java is not found

    [Reply]

  16. Maverick says:

    following error shows , when i try to run it once again..or any other apt-get install command is given

    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.24-1build0.10.04.1) but it is not going to be installed or
    ia32-sun-java6-bin (>= 6.24-1build0.10.04.1) but it is not installable
    Recommends: gsfonts-x11 but it is not going to be installed
    sun-java6-plugin: Depends: sun-java6-bin (>= 6.24-1build0.10.04.1) but it is not going to be installed
    E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

    [Reply]

  17. Eric des Courtis says:

    WARNING. The quotes are not the same as the bash quotes retype them manually

    [Reply]

  18. Gentl says:

    all i did was to go to the this websitehttp://archive.canonical.com/ after that i check all the folder for sun java in the partner folder and i download it….but have not run the application yet

    [Reply]

  19. MrOMGWTF says:

    Error: need a repository as argument
    -.-

    [Reply]

  20. C. F. M. says:

    As stated in early thread, manually delete and retype the ” before hitting enter.

    [Reply]

  21. thangaraj says:

    Thanks! Works like a charm!!!

    [Reply]

  22. Livie says:

    good tutorial, but you forgot to put it as deb http://archive.canonical.com/ubuntu lucid partner so that apt knows which distro it’s dealing with.

    [Reply]

  23. Intel107 says:

    Help me!
    When i try to add repository it says:
    Error: need a repository as argument
    help please

    [Reply]

  24. Adam says:

    Intel107: If you copy the command from the webpage, you need to change the fancy quotes to regular quotes (“) before running the command.

    [Reply]

  25. av says:

    Cannot go far then to “Konfiguracja pakietu sun-java6-jre”. Pressing ENTER does nothing. How to let the process to go and finish installation of Java Enviroment. Help, please.

    [Reply]

    admin Reply:

    Use tab key to select yes

    [Reply]

  26. aneill says:

    to accept licence agreement first click tab to highlight ok then hit return.

    [Reply]

    Antman Reply:

    THANK YOU admin… you helped me!

    [Reply]

  27. josy varkey says:

    need a repository as argument

    [Reply]

  28. leroyg says:

    For Server. You need to fire up you favorite editor. Edit repository list by uncommenting. sudo nano /etc/apt/sources.list

    uncomment deb http://archive.canonical.com/ lucid partner and save. then run sudo apt-get update

    then follow instructions above

    [Reply]

    leroyg Reply:

    This looks like its going to change my 10.04 server into a desktop.

    [Reply]

  29. petar says:

    try this way…
    apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

    then type this:
    sudo !!

    [Reply]

  30. Igor Passchier says:

    The package has been removed completely from the partner repository due to license issue, see https://lists.ubuntu.com/archives/ubuntu-security-announce/2012-January/001554.html

    [Reply]

Leave a Reply