Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

This question already has an answer here:

sudo add-apt-repository ppa:ferramroberto/java

After this command I am getting error:

Error reading Couldn't resolve host '
share|improve this question

marked as duplicate by Mitch, Kevin Bowen, Eric Carvalho, Raja, 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.

What's your output for ping –  pzkpfw May 16 '13 at 7:00
ppa:ferramroberto - in not a good repository –  Radu Rădeanu May 16 '13 at 7:18

1 Answer 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
share|improve this answer

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