Problems Installing Java 7 on Ubuntu

Asked

Viewed 930 times

-1

Hello!

I am trying to install Java 7 on Ubuntu. I used the following commands:

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

But at that moment returns the following message:

Err:15 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu artful Release<br>
404  Not Found<br>
Lendo listas de pacotes... Pronto<br>
E: The repository 'http://ppa.launchpad.net/openjdk-r/ppa/ubuntu artful<br>
Release' does not have a Release file.<br>
N: Updating from such a repository can't be done securely, and is therefore disabled by default.<br>
N: See apt-secure(8) manpage for repository creation and user configuration details.

And when I try to give sudo apt-get install oracle-java7-installer, it shows the following message:

O pacote oracle-java7-installer não está disponível, mas é referenciado por outro pacote.

This may mean that the package is missing, has become obsolete or is only available from another source

E: O pacote 'oracle-java7-installer' não tem candidato para instalação
  • Recommend this tutorial

  • 1

    Honestly I find it much easier to have a well-defined folder where my java installations will be and run directly, We hope there is no problem with the installation via package manager, but you are always hostage to the version of the repository, while using direct installations just download the version of java right on the oracle website, extract and ready.

1 answer

0

I am using Ubuntu 16.04 and for me these commands worked:

sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update   
sudo apt-get install openjdk-7-jdk

The Oracle repository request returns a 404, so I installed Openjdk.

To configure/manage installed java versions use the command:

sudo update-alternatives --config java

the response of the command will be something like this:

  Selecção   Caminho                                         Prioridade Estado
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java          1081      modo automático
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      modo manual
* 2            /usr/lib/jvm/java-8-oracle/jre/bin/java          1081      modo manual

Press <enter> to keep the current choice[*], or type selection number: 

Notice that you have a * in the alternative that is currently selected, there as described in the response of the command, you enter key to keep the selection current, or type the number of the alternative you want it to be the one selected from now on.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.