Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

This question already has an answer here:

I'm using Ubuntu 12.04 LTS. I'm trying to install Oracle JDK 7. When I tried to directly download the jdk-7u51-linux-x64.tar.gz from the official website, the download started and after downloading couple of MBs it stopped (you can try it as well, worked the same way for a friend). Using a guide.

led me to

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)

which is normal, as it is downloading from the same link. Exact report here

I tried to download and install the .rpm file. I converted it to deb and installed it. It appears as installed in the Software center, but could not find it via terminal (java -version returns suggestions for installing packages). Image from the Software center here

I tried everything here.

and could not find anything on the internet.

share|improve this question

marked as duplicate by belacqua, Warren Hill, Eliah Kagan, Eric Carvalho, mikewhatever Aug 2 '14 at 14:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

What happens if you wget the file, do you get the same behavior where it stops downloading? – pzkpfw Mar 17 '14 at 14:05
Yes, the same thing. The response is OK, but downloads just a small part of it: 2014-03-17 15:05:58 (478 MB/s) - `jdk-7u51-linux-x64.tar.gz' saved [5307/5307] When trying to open it, it shows it is corrupted of course. – Ivaylo Toskov Mar 17 '14 at 14:07
Can you run dpkg -L jdk? Also, there is OpenJDK in the main archives and Oracle JDK in an existing PPA. You didn't need to convert an RPM package. – saiarcot895 Mar 17 '14 at 14:11
Almost certainly a server error. It's telling you that the tar.gz is 5307 bytes which is wrong, and I'm getting the same behavior. Two "302 Moved Temporarily" followed by this incorrect file. – pzkpfw Mar 17 '14 at 14:12
Did you try the manual method here:… – i08in Mar 17 '14 at 14:49

I suggest you use webup8's PPA. I use it for Java 8, but there's also for Java 7.

See here for Java 7

and here for Java 8 (both can coexist in your system)

share|improve this answer

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