Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to install Java 7 in Ubuntu 13.04 using this tutorial.

Preparing your system

First you need to remove openjdk for this run the following command from your terminal
sudo apt-get purge openjdk*

If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here
sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get update

Install Oracle Java 7 in Ubuntu 13.04/12.10/12.04

Open the terminal and run the following commands

sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer

All goes well until I reach the point:

sudo apt-get install oracle-java7-installer

Then I just get the error message

E: Unable to locate package oracle-java7-installer

What is the problem that is causing this?

share|improve this question
    
Did you add ppa for oracle-java7-installer package successfully? –  cuonglm May 15 at 17:33
1  
13.04 is end of life. You can add the PPA from bobberson012 but you really should upgrade. –  Rinzwind May 15 at 17:38

2 Answers 2

up vote 4 down vote accepted

You first have to add the WebUPD8 repository to your system:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Then install the package oracle-java7-installer.

If you already added the repository to your system, it could be you just never performed a sudo apt-get update, to update the package list.

Another option is OpenJDK.

share|improve this answer
    
The tutorial am using has it. ubuntugeek.com/… –  Alex Kasina May 15 at 17:37
    
That is the tutorial he referred to. –  ItsBobberson May 15 at 17:38
    
See sudo add-apt-repository ppa:webupd8team/java and sudo apt-get update is already in the tutorial and its not working. I still get the error. –  Alex Kasina May 15 at 17:45
    
You already ran sudo apt-get purge openjdk*, right? –  ItsBobberson May 15 at 18:14
    
Also, can I ask why you want to use Oracle Java 7 instead of OpenJDK? –  ItsBobberson May 15 at 18:19

If you don't want to resort to OpenJDK, you can just use a different Ubuntu version in your /etc/apt/sources.list.d/webupd8team-java.list file:

deb http://ppa.launchpad.net/webupd8team/java/ubuntu quantal main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu quantal main

Instead of "quantal" you can probably use any of the values from the drop-down list named "Published in:" on the WebUPD8 team page. I'm on "raring" which is not available directly, but this works perfectly.

Rationale: the installers provided by WebUPD8team simply download and run the official Java installer from Oracle, which is the same for all versions of Ubuntu (currently anyway). Therefore it does not matter which "installer installer" you really use.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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