Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

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
share|improve this question
    
What's your output for ping launchpad.net? –  bigbadonk420 May 16 '13 at 7:00
    
ppa:ferramroberto - in not a good repository –  Radu Rădeanu May 16 '13 at 7:18
add comment

marked as duplicate by Mitch, Kevin Bowen, Eric Carvalho, raaz, Jorge Castro May 16 '13 at 12:46

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.

1 Answer

  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
    
share|improve this answer
add comment

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