Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an Ubuntu 13.04 64-bit installed and I would like to install JDK 7 for Oracle Sql Developer. My problem is when I try to install it I get the next:

kwarr@kwarr-K54LY:~$ sudo apt-get install oracle-java7-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  visualvm ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho
  ttf-sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/17,6 kB of archives.
After this operation, 110 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package oracle-java7-installer.
(Reading database ... 200447 files and directories currently installed.)
Unpacking oracle-java7-installer (from .../oracle-java7-installer_7u51-0~webupd8~1_all.deb) ...
oracle-license-v1-1 license has already been accepted
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for shared-mime-info ...
Setting up oracle-java7-installer (7u51-0~webupd8~1) ...
Downloading Oracle Java 7...
--2014-03-22 15:18:09--
Resolving (,
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2014-03-22 15:18:10--
Resolving (
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: [following]
--2014-03-22 15:18:10--
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 200 OK

    The file is already fully retrieved; nothing to do.

Download done.
Removing outdated cached downloads...
sha256sum mismatch jdk-7u51-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
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have already searched the internet and find some solution that worked for people:

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


sudo dpkg -P oracle-java7-installer
sudo apt-get -f install
sudo apt-get install oracle-java7-installer

but none of them worked for me. Still get the same message. Could someone help me with this?

share|improve this question

closed as off-topic by i08in, user68186, Braiam, Avinash Raj, Radu Rădeanu Mar 23 '14 at 8:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

It's not a problem on your side, but a change on Oracle's side. Instead of the tarball being downloaded an error page is being downloaded that says that you have to agree to the license terms. This doesn't work so well for an automated download. – saiarcot895 Mar 22 '14 at 15:48
You can try using the openjdk7 – cshubhamrao Mar 22 '14 at 15:52
I installed openjdk7 and it works now. Thanks! – kwarr Mar 22 '14 at 16:36

Please follow below steps to install oracle java:

  • Download the latest Java SE SDK version.

  • Untar the Archive:

    tar -xzvf /root/jdk-7u17-linux-x64.tar.gz
    mv jdk1.7.0_17 /opt
    cd /opt/jdk1.7.0_17
  • This step registers the downloaded version of Java as an alternative, and switches it to be used as the default:

    update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_17/bin/java 1
    update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_17/bin/javac 1
    update-alternatives --install /usr/lib/mozilla/plugins/ /opt/jdk1.7.0_17/jre/lib/amd64/ 1
    update-alternatives --set java /opt/jdk1.7.0_17/bin/java
    update-alternatives --set javac /opt/jdk1.7.0_17/bin/javac
    update-alternatives --set /opt/jdk1.7.0_17/jre/lib/amd64/
  • Test

    To check the version of Java you are now running

    java -version

    To check the browser plugin browse to and click “Do I have Java?”

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.