How to install JDK 6 from a bin file on Ubuntu 12.04 LTS 64 bit

13,211

Follow the instructions on JDK Self-Extracting Installation for Linux (64-bit) to install the 64-bit JDK on Ubuntu. Basically you need to make the file executable ( chmod +x jdk-6u43-linux-x64.bin) and then run it (./jdk-6u43-linux-x64.bin).

There is a note in the docs on running this with root access to install to a shared, system location such as /usr/local or /usr/java. If installing to one of these locations I usually change directory there and run the installer from that location.

You may also want to reference the Ubuntu Java page, as it has some instructions on setting-up alternatives to include the new Java install.

Share:
13,211
Roy Hinkley
Author by

Roy Hinkley

Updated on September 18, 2022

Comments

  • Roy Hinkley
    Roy Hinkley over 1 year

    The Android Open Source project requires JDK 6. From posts I have read all over, the Open Source JDk will not work. I have tried many things from numerous posts here and on other webs to no avail. Either the solutions are not for 64 bit, or the repos no longer are available.

    When running:

    $ sudo apt-get install sun-java6-jdk
    

    I get:

    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
    

    I have downloaded the binary from Oracle directly, but I don't know how to install it:

    jdk-6u43-linux-x64.bin
    

    Please advise