Error when installing oracle-java7-installer

Well looks like this is an old question but no one has answered it yet so... better late than never I guess. I've been ripping my hair out over this too. Like you most boards just tell me too use open-jdk. what most people don't seem to understand that open-jdk and jdk-7 are not one to one mappings of each other and many tools relied upon by developers simply don't work with open-jdk. ANYWAY...

I found a solution which solved the problem for me. Hopefully it will work for you.

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

As @Ahmad-sibai said

"Recently, webupd8 team stopped distributing their installer for Oracle java 7."

What you can do is to:

  1. manually download them from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html and put them in cache if you have an Oracle Support account and you really need Oracle JDK 6 or 7.

  2. Place them in the following folder:

    /var/cache/oracle-jdk6-installer/ for JDK 6 (you'll need version 6u45)
    /var/cache/oracle-jdk7-installer/ for JDK 7 (you'll need version 7u80 for 32bit and 64bit or 7u60 for arm)
    
  3. Install again using the webupd8 installers

    sudo apt-get install oracle-java7-installer
    

Recently, webupd8 team stopped distributing their installer for Oracle java 7.


I tried Ben Glasser's answer, but it didn't work.

It tried the other answer here, https://stackoverflow.com/a/22955890/1198772, and it works.

We just need to download (manually) the latest jdk from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html, and replace the old jdk. Then try to install again.