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

You may also like...

127 Responses

  1. ramesh says:

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

  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!

  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?

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

  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 😛

  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.

  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 😛

  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?

  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?

  10. Rudolf says:

    Many thanks!

  11. bob fucking dole says:

    SUDO APT-GET UPDATE

    DO IT AGAIN BEFORE WHINGING ABOUT NOT FOUND ERRORS

    THIS IS LINUXXXX

  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…

  13. chandra sekar says:

    Its very usefull for me.

  14. wal id says:

    worked perfect thanx

  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

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

  17. Eric des Courtis says:

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

  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

  19. MrOMGWTF says:

    Error: need a repository as argument
    -.-

  20. C. F. M. says:

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

  21. thangaraj says:

    Thanks! Works like a charm!!!

  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.

  23. Intel107 says:

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

  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.

  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.

  26. admin says:

    Use tab key to select yes

  27. aneill says:

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

  28. Antman says:

    THANK YOU admin… you helped me!

  29. josy varkey says:

    need a repository as argument

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

Leave a Reply

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