0
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
Radu Rădeanu
  • 169,590
Bhagya
  • 9
  • 2

1 Answers1

1
  1. 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
    
  2. After the installation you have enable the jdk:

    update-alternatives –display java
    
  3. Check if Ubuntu uses Java JDK 7

    java -version
    

    The correct answer should be like this:

    javac 1.7.0_07
    
  4. 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
    
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83