How to Install Java Runtime Environment (JRE) in Ubuntu 9.04 (Jaunty)

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.

Currently Ubuntu has the following Java packages

sun-java6-bin -- Contains the binaries

sun-java6-demo -- Contains demos and examples

sun-java6-doc -- Contains the documentation

sun-java6-fonts -- Contains the Lucida TrueType fonts from the JRE

sun-java6-jdk -- Contains the metapackage for the JDK

sun-java6-jre -- Contains the metapackage for the JRE

sun-java6-plugin -- Contains the plug-in for Mozilla-based browsers

sun-java6-source -- Contains source files for the JDK

Installing the Java Runtime Environment

First you need to check multiverse repository enabled or not after that open a terminal window. Since you are going to be installing the JRE and the web browser plug-in, you’ll be using the following command from a terminal

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

Once it downloads the 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.

l1

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.

l2

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

You should get similar output

l3

Testing Java Plugin for Firefox

open Firefox and typing about:plugins in the address bar and check for java plugin

l4

Sponsored Link

You may also like...

86 Responses

  1. Scott says:

    I installed java per the instructions, but no java plugin appears in the firefox about:plugins listing. Also, I tried running sudo apt-get -update, but received this message:

    E: Command line option ‘p’ [from -update] is not known.

    Any ideas? Thanks.

  2. J.Simons says:

    I never succeeded in running Jin from Java with Fics until I found this howto.
    Many thanks
    Sincerely Joop Simons

  3. Richie says:

    This is what I am getting after I typed in
    “sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts.” Please help. Thanks

    vista@ubuntu:~$ sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
    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?
    vista@ubuntu:~$ java -version
    The program ‘java’ can be found in the following packages:
    * gij-4.3
    * java-gcj-compat-headless
    * openjdk-6-jre-headless
    * cacao
    * gij-4.2
    * jamvm
    * kaffe
    Try: sudo apt-get install
    bash: java: command not found

  4. Richie says:

    After I typed in “java -version”, I got the following message:

    vista@ubuntu:~$ java -version
    The program ‘java’ can be found in the following packages:
    * gij-4.3
    * java-gcj-compat-headless
    * openjdk-6-jre-headless
    * cacao
    * gij-4.2
    * jamvm
    * kaffe
    Try: sudo apt-get install
    bash: java: command not found

    What should I do now?

  5. John.St says:

    Rad older comments, use Synaptic Package Manager solution from September(?).

  6. John.St says:

    Not Sep., Synaptic comment date probably some time in July or August

  7. Richie says:

    Do I have to undo this first? ““sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts.” “

  8. Richie says:

    Could you be more specific about which entry to follows to fix my problem and install Java? I am new in Ubuntu. Thanks

  9. Richie says:

    When I chose System>Administration>You have 1 broken package on your system!Synaptic Package Manager, I got the following message:

    Use the “Broken” filter to locate it.

    Please help. Many thanks

  10. John.St says:

    This is how I worked around the problem:

    Open a terminal window.

    Write:

    sudo ls

    (give password – sudo remembers for app. 10 minutes, so this is cheat to let you use sudo w/o password).

    Write:

    sudo apt-get -f install

    sudo apt-get -update

    Sometimes you need to run sudo apt-get -update a couple of times.
    this should clean up

    Start (from menu)
    System -> Administration -> Synaptic Package Manager

    Select All
    Write jre in search window
    Select
    Install

  11. Richie says:

    System -> Administration -> Synaptic Package Manager

    Select All
    Write jre in search window
    Select
    Install

    I couldn’t find “select all”. Did you mean do ALL?
    Should I choose “sun-java6-plugin’?

    I am new in Ubuntu and please excuse my stupidity.

    Thanks

  12. John.St says:

    We all have to start somewhere – usually from the beginning – at least that where I started 🙂

    System -> Administration -> Synaptic Package Manager

    In the upper left corner you see the word All

    It is probably already selected, if not, click on it (the word then changes from normal text to bold).

    In the “Quick search” box, write: jre

    Now Synaptic Package Manager shows a list of all java-related software + probably openoffice.org.

    select for installation the boxes for all products the name of which *begins with* “sun-java6” and “openjdk-6” and “default-jre”

    Some of them probably get selected automatically, and you select the remaining.

    If you haven’t installed it already, it’s a good idea to select openoffice.org too – an excellent and free M$oft office substitute.

  13. John.St says:

    Correction: The word All is always shown in bold, click on it and it gets highlighted.

  14. Richie says:

    John.St, Thank you so much for your help. Ubuntu is different, but it is definitely faster than Windows. Do I need to install any anti-virus, anti-spyware and firewall too? Thanks again.

  15. John.St says:

    Richie,

    YES absolutely!

    UBUNTU is much less vulnerable than Windows, but still vulnerable, as any PC is.

    A firewall is a MUST – I have some 200 attempt to access my computer per day, most of them simply erratic attempts to connect to some other PC, but 20-30 ICMPs to locate me + attempts to connect to ports which usually aren’t used for anything and thus may be left open by mistake. For the past 12 minute, at 30 sec. intervals, some idiot has been trying to TCP my port 0 (used for ICMP = ping) – poor dope.

    About security:

    http://www.ubuntugeek.com/list-of-security-tools-available-in-ubuntu.html

  16. JP says:

    Thanks a Bunch. 🙂

  17. John.St says:

    Autostart Firestarter – ignore the 7.04

    It works with 8.* and 9.04 jaunty as well

  18. Richie says:

    1) Is Firestarter automatically when I turn on my PC?
    2) I tried Avast, but was different than Windows’ version. What anti-virus software is good for Ubuntu 9.04? Thanks for your help

  19. Richie says:

    When I tried to play Bloomberg TV, it didn’t work because of missing Windows Media Speech decoder. Do you know how to get Bloomberg TV works? I have tried to install Mplayer, VLC etc, but nothing seems to work. Thanks for your help

  20. Steven says:

    I’m not good at terminal commands so…Scrap all the terminal stuff and go to System, Administration, Synaptic Package Manager. When you get there, search for ‘sun-java6 and all the sun-java6 files will appear. Install the files listed at the beginning of this ‘How-to’ article. (sun-java6-bin – Contains the binaries

    sun-java6-demo – Contains demos and examples

    sun-java6-doc – Contains the documentation

    sun-java6-fonts – Contains the Lucida TrueType fonts from the JRE

    sun-java6-jdk – Contains the metapackage for the JDK

    sun-java6-jre – Contains the metapackage for the JRE

    sun-java6-plugin – Contains the plug-in for Mozilla-based browsers

    sun-java6-source – Contains source files for the JDK)

    This is what worked for me with no problems with 9.0.4.

  21. Ali says:

    I installed openJDK once, after Uninstalling it. I tried to install sun-java6-jdk and other stuffs, they install normally with Synaptec, but in terminal java and javac shows gij and Eclips compiler.
    how can I change the java’s link to correct path and where is it?

  22. Titus Gitau says:

    I wish to install java in my ubuntu how do i do that please help. My email address is [email protected]

  23. Deep says:

    thanx a lot

    It worked for karmic Koala as well

    i was frustrated as nothing else worked till i saw this

    and it worked like magic

  24. Max Williams says:

    Reg – you star, thankyou. I wish i’d read to the bottom of the comments before i started trying to use synaptic instead (which failed because dpkg was locked out).

  25. suresh says:

    Hello friend,
    Thank you very much for this,how to install java in ubuntu 9.04:>>
    It is more help ful for me<<works on my Desktop(which I am doubtful as I am beginner in it)

  26. Eliza Wilkins says:

    Thank you Thank you Thank you — worked like a dream!!!

  27. Johnny2good says:

    John.St says:
    October 2, 2009 at 3:37 pm

    This is how I worked around the problem:

    Open a terminal window.

    Write:

    sudo ls

    (give password – sudo remembers for app. 10 minutes, so this is cheat to let you use sudo w/o password).

    Write:

    sudo apt-get -f install

    sudo apt-get -update

    Sometimes you need to run sudo apt-get -update a couple of times.
    this should clean up

    John.St Thanx bro it was doing my head in my prob was when i ran sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
    it ran ok but when it came to >> Operating System Distributor License for Java and hit Enter to continue. gurrr hit enter and nothing so then i was Broken” filter did what you said worked after 2 tries hehe nice one… O that was on ubuntu 9.10

  28. Sutar Raghvendra says:

    Thank u Very Much…….

  29. hartown says:

    Many thanks

  30. maxsachi says:

    this is very helpful for me keep going and good luck.

Leave a Reply

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