How to install oracle java 7 in ubuntu 13.04/12.10/12.04

Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.

Preparing your system

First you need to remove openjdk for this run the following command from your terminal

sudo apt-get purge openjdk*

If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update

Install oracle java 7 in ubuntu 13.04/12.10/12.04

Open the terminal and run the following commands

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

You can check the java version by searching java in dashboard

Sponsored Link

Incoming search terms:

Related posts

83 thoughts on “How to install oracle java 7 in ubuntu 13.04/12.10/12.04

  1. I had a problem with this. I was getting

    sha256sum mismatch jdk-7u3-linux-x64.tar.gz

    I checked the file in
    /var/cache/oracle-java7-installer

    and it looked like it was invalid

    I was able to fix it by directly downloading the file from oracle, putting it in the cache directory and then editing

    /var/lib/dpkg/info/oracle-java7-installer.postinst

    and bypassing ths download and sha check

    This problem just started happening today, I used the package successfully yesterday on a different computer

  2. The problem is that the java download package is malformed and only contains an Unauthorized Download message and info.

    It seems Oracle prevents direct downloads

  3. Thanks – that solved the problem for me too – just had to put the jdk-7u3-linux-x64.tar.gz file into /var/cache/oracle-java7-installer/ and then comment out the code between ‘echo “Downloading…”‘
    and ‘echo “Download done”‘ in the /var/lib/dpkg/info/oracle-java7-installer.postinst script.

  4. Use a text editor to open the file and put a “#” at the start of each line between ‘echo “Downloading…”‘
    and ‘echo “Download done” in the file, then save it.

  5. I had this problem too!
    ?????: “./jdk-7u3-linux-x64.tar.gz”

    0K ..... 100% 574M=0s

    2012-04-10 11:23:56 (574 MB/s) - ??? “./jdk-7u3-linux-x64.tar.gz” [5307/5307])

    Download done.
    sha256sum mismatch jdk-7u3-linux-x64.tar.gz
    Oracle JDK 7 is NOT installed.
    dpkg??? oracle-java7-installer (--configure)????
    ??? ??? post-installation ?? ?????? 1
    ??????????
    oracle-java7-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  6. Pls help. I am facing the same problem here. I am not able to install any version of java, and my entire work has stopped because of this! 🙁 I am on Natty!

  7. Hi Anthony, i make that change, it’s pass, and i need to comment the code for a “verify SHA256 checksum” but now a get this error:

    mv: impossível obter estado de “jdk1.7.0_03”: Arquivo ou diretório não encontrado
    dpkg: erro processando oracle-java7-installer (–configure):
    sub-processo script post-installation instalado retornou estado de saída de erro 1
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    Do you now how can i fix this?

  8. I don’t speak spanish – can you translate that for me?

    Also, I don’t know why you need to comment the code for verifying the SHA256 checksum… why are you doing that?

  9. Anthony,

    i need to comment the SHA256 checksum because give me a error and stop.

    Here:

    mv: can not get status “jdk1.7.0_03”: File or directory not found
    dpkg: error processing oracle-java7-installer (- configure):
    subprocess post-installation script returned error exit status 1
    E: Sub-process / usr / bin / dpkg returned an error code (1)

    falzer the error continue..

  10. maybe you commented something in post-installation that was not to be commented. have u tried it from beggining?

  11. Hi…

    After some errors and testing, i found out that following the proposal of falzer is the best solution.

    Thanks for that falzer.

  12. I followed falzer’s solution and still, I got this:

    Download done.
    sha256sum mismatch jdk-7u3-linux-x64.tar.gz
    Oracle JDK 7 is NOT installed.
    dpkg: error processing oracle-java7-installer (–configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of oracle-jdk7-installer:
    oracle-jdk7-installer depends on oracle-java7-installer; however:
    Package oracle-java7-installer is not configured yet.
    dpkg: error processing oracle-jdk7-installer (–configure):
    dependency problems – leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
    Errors were encountered while processing:

  13. that basically means that the checksum in the install script did not match,

    you may have downloaded jre 7u4 instead of 7u3

  14. This is what works for me

    sudo rm /var/lib/dpkg/info/oracle-java7-installer*
    sudo apt-get purge oracle-java7-installer*
    sudo rm /etc/apt/sources.list.d/*java*
    sudo apt-get update
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java7-installer

  15. Nope, no workie:
    ric@Iam:~$ sudo apt-get install oracle-java7-installer
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    oracle-java7-installer is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? y
    Setting up oracle-java7-installer (7u4-0~webupd8~4) …
    Removing outdated cached downloads…
    Downloading cookie…
    –2012-06-12 02:48:22– http://launchpadlibrarian.net/98645053/cookie.txt
    Resolving iam.wayward4now.net (iam.wayward4now.net)… 192.168.0.2
    Connecting to iam.wayward4now.net (iam.wayward4now.net)|192.168.0.2|:3142… connected.
    Proxy request sent, awaiting response… 403 Forbidden file type or location: http://launchpadlibrarian.net/98645053/cookie.txt
    2012-06-12 02:48:22 ERROR 403: Forbidden file type or location: http://launchpadlibrarian.net/98645053/cookie.txt.

    download failed
    Oracle JDK 7 is NOT installed.
    dpkg: error processing oracle-java7-installer (–configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    oracle-java7-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    ric@Iam:~$

  16. p/s this was my second attempt after following all the instructions to remove all traces of a previous install.

  17. Thanks Cga works very well !!, it installed very well, in firefox and google chrome !

    Hey ubuntu geek website, please can you add cga response to your post in update, I’m sure it’ll help lots of people !! 🙂

  18. As @poltiser said:
    Add the repository and update repositories.
    Then, open Synaptic and install Oracle Java.

    Done.

Leave a comment

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