sudo add-apt-repository ppa:ferramroberto/java
After this command I am getting error:
Error reading https://launchpad.net/api/1.0/~ferramroberto/+archive/java: Couldn't resolve host 'launchpad.net
To add our PPA and install the latest Oracle Java (JDK) 7 in Ubuntu, use the commands below:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-jdk7-installer
After the installation you have enable the jdk:
update-alternatives –display java
Check if Ubuntu uses Java JDK 7
java -version
The correct answer should be like this:
javac 1.7.0_07
Adding JAVA_HOME to environment
Edit the file /etc/environment
and add JAVA_HOME=/usr/lib/jvm/java-7-oracle
to the end of the file.
First open a Terminal (Applications → Accessories → Terminal), then enter:
sudo gedit /etc/environment
ping launchpad.net
?