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. Am I missing something? The Testing section says there is a two step process, but only one (java -version) is shown

    [Reply]

  2. I am still getting an error.
    Error: need a repository as argument

    All I did was copypasta. Is there something else that I might be missing?

    [Reply]

  3. Thanks for this!

    Witch: The quote marks don’t go through clip board properly. You’ll need to write them manually.

    [Reply]

  4. Thanks for the help…

    @Witch you may need to type the command manually because the inverted commas “” are not copied correctly.

    [Reply]

  5. Argh! This fails for me.

    ###
    david@david-netbook:~/SyncDocs-0.6.7$ 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 am I doing wrong? :S

    [Reply]

  6. Every time I run sudo apt-get update I get an error:
    “malformed line 54 in source list /etc/apt/sources.list (dist parse)”

    I know absolutely nothing about Linux (just installed it today), so any help would be appreciated.

    [Reply]

  7. I followed instruction below. When I get to the license screen and hit enter nothing happens. So I cannot agree and the installation will not finish. How do I get out of this bind?

    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.

    [Reply]

  8. To add the repository, you can also go:
    System -> Administration -> Software Sources
    Then click on the “Other Sources” tab. Then just check the box of the ‘http://archive.canonical.com/ubuntu lucid partner’ option, then click close. it will reload and be usable.

    [Reply]

  9. Thanks Colin! That did it, though I had to change to the main server, since my default server was apparently down…

    [Reply]

  10. Hey Frank Boxall I’m a complete newbe. I got the same error. SOLUTION: Randomly I selected Terminal > Reset; that got me back into the native terminal stuff. Then I looked back up the guff and saw ‘Selecting previously deselected packunixodbc.’ With the cursor I highlighted the Ok; pressed Enter and – hey – it all installed!

    [Reply]

  11. That should read ‘Selecting previously deselected pack@Ok@unixodbc.’ but with greater than less than signs instead of @. Something funny with paste on this page.

    [Reply]

  12. Hello Lawrence – I’m glad you found a way to install Java. After much flopping around I was able to agree to the license by hitting the tab key, which activated the yes box, and then hitting enter. So now I have Java working.
    The Ubuntu crew should have put Java in the 10.4 distro. By leaving it out, they caused all sorts of misery for dum-dums like us.

    [Reply]

  13. 2 small issues here:
    – copy + paste will not work:
    sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
    Error: need a repository as argument
    Instead this works:
    sudo add-apt-repository “deb http://archive.canonical.com/ lucid partner”
    (seen it, ” ” vs. “ ”)
    If you have already the openjdk installed you must switch to the new sun-jdk:
    sudo update-java-alternatives -l
    gives
    java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
    java-6-sun 63 /usr/lib/jvm/java-6-sun
    To use the sun jdk you must:
    sudo update-java-alternatives -s java-6-sun

    Thats all.

    [Reply]

  14. Thanks Allan & the author of the post,

    1. sudo nano /etc/apt/sources.list
    2. uncomment the partner repository. Exit and save.
    3. You must sudo apt-get update
    4. sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
    Accept the DLJ License. That’s all . . .
    /Sunny

    [Reply]

  15. For what it’s worth, I am finding many times when I run some Update from Pkg Manager, the Java settings in /usr/lib/mozilla/plugins gets changed, and that screws up Thunderbird/Lightning and some Firefox settings, particularly for Webex. What seems to work for the 3 critical logical links for my installation so far:

    ln -s /usr/lib/firefox/plugins/flashplugin-alternative.so

    ln -s /usr/lib/jvm/java-6-sun-1.6.0.20/jre/plugin/i386/ns7/libjavaplugin_oji.so
    (This one depends on where you have Sun Java installed)

    ln -s /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386/libnpjp2.so

    Your mileage may may vary, so look for where these are in your installation, change the links and see what works

    [Reply]

  16. How to install java 5 on Lucid?
    i mean instead of java 6, as i have an application in which facing a problem with java 6 and i have to downgrade.
    and i tried many ways to get java5 and java5 plugin on lucid but no success at all.

    [Reply]

  17. my terminal just replied that after typin the name below

    sudo apt-get update
    E: Malformed line 54 in source list /etc/apt/sources.list (dist parse)

    [Reply]

  18. Kev phreak, likely a typo on line 54 oif that file, and that file is what tells Ubuntu where to look for the updates.

    The safest way (for me, who can’t type worth a damn) is to copy and paste one of the known good lines, then alter it carefully to fit what the new needed repository might be. That way you can also avoid the weirdness of the quotation mark issue.

    Also, note what Eddy Higgins says above your message, the format of the command: , all inside the proper quotes.

    Roger

    [Reply]

  19. What does: “Uncomment the partner repository. Exit and save.” mean? How do you do that? I keep getting the message: “E: malformed line 54 in source list /etc/apt/sources.list (dist parse) E: The list of sources could not be read.” What do I do?

    [Reply]

  20. Mike,panic not. Open a terminal window. Type:
    sudo gedit /etc/apt/sources.list

    The file will open. In that file you will find some lines that are what you would think of as more or less normal, others that start with a # or ##. Those # signs are interpreted by Unix as “don’t read this line”, so *nix ignores whatever follows the # sign on that line.

    E.g.
    This line would be read
    # This line would not be read, so is good for…

    You guessed it: comments in the code. Hence the phrase. To “uncomment” means to remove the # sign. That way Unix or Linux will read the line into whatever is going on.

    You may find something like this in that file:
    # deb http://archive.canonical.com/ubuntu lucid partner

    Take out the # sign and this line now becomes active to the Synaptic Package Manager once you Reload. This Reload within Package Manager will cause the Package Manager to re-read the sources.list file and go get the list of packages available on the now uncommented sites – in this case, the partners.

    If it is not for lucid (10.x) substitute your version (jaunty, etc) in the appropriate place within the command.

    And if you are getting an error on line 54, count down 54 lines from the top of the file, including spaces between paragraphs, and you will find the line with the error. Look at it carefully, compare it with others, look for typos. Believe me, the system knows. If you can’t find the error, you are either not looking well enough, or not looking at the correct line. Been there, done that, felt stupid. Welcome to the club. Only a well-flayed player can call himself a geek, eventually.

    Roger

    [Reply]

Leave a comment

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