I can\'t install oracle java 7 following the steps provided in this link: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
sudo ad
sudo dpkg -P oracle-java7-installer
sudo apt-get -f install
openjdk-8-jdk
.Please follow below steps to install oracle java:
Download the latest Java SE SDK version.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Untar the Archive:
tar -xzvf jdk-8-linux-x64.tar.gz
mv jdk1.8.0 /opt
cd /opt/jdk1.8.0
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.8.0/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1
update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so 1
update-alternatives --set java /opt/jdk1.8.0/bin/java
update-alternatives --set javac /opt/jdk1.8.0/bin/javac
update-alternatives --set mozilla-javaplugin.so /opt/jdk1.8.0/jre/lib/amd64/libnpjp2.so
Test
To check the version of Java you are now running
java -version
Output
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
To check the browser plugin browse to http://www.java.com/ and click “Do I have Java?”
Ref: https://askubuntu.com/questions/437776/ubuntu-13-04-unable-to-install-jdk7
The reason is : WHY ORACLE JAVA 7 AND 6 INSTALLERS NO LONGER WORK
If you have an Oracle Support account and you really need Oracle JDK 6 or 7, you can get the installers from the WebUpd8 PPA to work by downloading the binaries and placing them in the following folder:
... and then install the oracle-java6-installer or oracle-java7-installer package.
i think that your download is corrupted you have to remove the corrupted package first by code :
sudo apt-get purge oracle-java7-installer
clean your apt :
sudo apt clean
remove and reimport the ropsitory:
sudo add-apt-repository --remove ppa:webupd8team/java
sudo apt-get update
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
install your package again :
sudo apt-get install oracle-java7-installer
enjoy it bro ! if the problem hasn't solved try using VPN . Maybe there is a filtering between you and the oracle website
Tried with the solution but still not working. Even when I tried to download the jdk tar from the Oracle site it still failed at around 30-50MB. Anyway I found an article which talks about it and finally got it fixed!
Oracle Adds License to oracle-java7-installer and Now It Fails (published on March 2014)
Basically the steps are similar except the last one:
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer