Skip to content

Install Java6 on Ubuntu

November 17, 2012

Hi all,

Let us install sun-java6-jdk on ubuntu.

On Ubuntu 10.04:

Now This are the standard method to install it.

Open your terminal by Ctrl+Alt+T

$sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$sudo apt-get update
$sudo apt-get install sun-java6-jdk

Now I guess You will encounter with this problem in last step.

Package sun-java6-jdk 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-jdk has no installation candidate

Now the solution to this is:

$sudo add-apt-repository ppa:ferramroberto/java
$sudo apt-get update
$sudo apt-get install sun-java6-jdk

And finally you have installed sun java6 on your ubuntu 10.04

 

On Ubuntu 12.04:

To install sun java6 on ubuntu 12.04 follow this steps:

Open your terminal by Ctrl+Alt+T

Enter following commands and you will get sun java6 installed on your system.

$wget https://github.com/flexiondotorg/oab-java6/raw/0.2.6/oab-java.sh -O oab-java.sh

This will download the script to install sun java.

After that provide executable permission to that script.

$chmod +x oab-java.sh

And after that execute the script

$sudo ./oab-java.sh

I don’t know who is the author of this script, but hats off to that guy, that made our work so easy to install java.

Well, Now a little bit of patience, so that this script downloads some packages required.

After that execute installation commands:

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

Enjoy…

Advertisements

From → Ubuntu

13 Comments
  1. sandeep dange permalink

    m stuckd at executing ./oab-java.sh command..
    here is my output script after executing it.

    sandeep@sandeep-Inspiron-N5010:~$ gksu ./oab-java.sh
    oab-java.sh v0.2.6 – Create a local ‘apt’ repository for Sun Java 6 and/or Oracle Java 7 packages.

    Copyright (c) Martin Wimpress, http://flexion.org. MIT License

    By running this script to download Java you acknowledge that you have
    read and accepted the terms of the Oracle end user license agreement.

    * http://www.oracle.com/technetwork/ja…terms/license/

    If you want to see what this is script is doing while it is running then execute
    the following from another shell:

    tail -f /home/sandeep/oab-java.sh.log

    [x] Installing Java build requirements success
    [x] Making build directories success
    [x] Removing clones of https://github.com/rraptorr/sun-java6 success
    [x] Cloning https://github.com/rraptorr/sun-java6 success
    [x] Checking out v6.38-1 success
    [x] Getting Java SE download page success
    [x] Getting current release download page success
    [x] Downloading jdk-6u38-linux-i586.bin : 68.45 MB success
    [x] Symlinking jdk-6u38-linux-i586.bin success
    [x] Downloading jdk-6u38-linux-x64.bin : 68.72 MB success
    [x] Symlinking jdk-6u38-linux-x64.bin success
    [x] Getting Java Cryptography Extension download page success
    [x] Downloading jce_policy-6.zip : 8.89 KB success
    [x] Symlinking jce_policy-6.zip success
    [x] Updating the changelog success
    [x] Building the packages success
    [x] Moving the packages success
    [x] Creating Packages.gz file success
    [x] Creating Release file success
    [x] Signing the ‘Release’ file success
    [x] Exporting public key success
    [x] Adding public key success
    [x] Update package list failed
    [i] Showing the last 5 lines from the logfile (/home/sandeep/oab-java.sh.log)…
    success
    [x] Update package list E: Malformed line 59 in source list /etc/apt/sources.list (dist parse)
    E: The list of sources could not be read.
    7027’s retcode: 100
    failed

    i marked the error as bold text in above output script. Please help me out of these.
    thanks in advance

  2. Can you provide your “/etc/apt/sources.list” file contents here?…

  3. sandeep dange permalink

    k

  4. sandeep dange permalink

    i dono wat’s happening here.. wen i paste my output script it’s not getting displayed over here.. unlike my previous reply..

    can i get your email-id to send you the contents

      • Execute this two commands and let me know the results:
        # sudo dpkg –configure -a
        # sudo apt-get update

        That will reconfigure & update your repository URIs, try to install java again. I think it should work.

      • sandeep dange permalink

        sandeep@sandeep-Inspiron-N5010:~$ sudo dpkg –configure -a
        sandeep@sandeep-Inspiron-N5010:~$ sudo apt-get update
        E: Malformed line 59 in source list /etc/apt/sources.list (dist parse)
        E: The list of sources could not be read.

        still the same problem.

  5. sandeep dange permalink

    problem solved.
    need to edit last two url lines of /etc/apt/sources.list

    thanx a lot pratik.

  6. rmgoncalo permalink

    Thanks a lot 😉

    If you have this problem:
    “wget: unable to resolve host address `jce_policy-6.zip’
    16129’s retcode: 4
    failed”

    This is how you fix it:
    https://github.com/flexiondotorg/oab-java6/issues/101

  7. Jasmine permalink

    I facing this error message whe i was trying to download JAVA 6 on 12.004 LTS “dpkg was interrupted, you must manually run ‘sudo dpkg –configure -a’ to correct the problem. ” What should I do?

  8. lekshmi217 permalink

    Mr.Sandeep, what is the correction u made in sources.list?
    i 2 hv same problem..

  9. lekshmi217 permalink

    [x] Installing Java build requirements success
    [x] Making build directories success
    [x] Removing clones of https://github.com/rraptorr/sun-java6 success
    [x] Cloning https://github.com/rraptorr/sun-java6 success
    [x] Checking out v6.45-1 success
    [x] Getting Java SE download page success
    [x] Getting current release download page success
    [x] Getting previous releases download page success
    [x] Downloading jdk-6u45-linux-i586.bin : 68.47 MB success
    [x] Symlinking jdk-6u45-linux-i586.bin success
    [x] Downloading jdk-6u45-linux-x64.bin : 68.75 MB success
    [x] Symlinking jdk-6u45-linux-x64.bin success
    [x] Getting Java Cryptography Extension download page success
    [x] Downloading jce_policy-6.zip : success
    [x] Symlinking jce_policy-6.zip success
    [x] Updating the changelog success
    [x] Building the packages success
    ERROR! Packages failed to build.

    this is my error..
    help this out

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: