Problems Installing Java 7 on Ubuntu

0

Hello

I'm 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 this point, it 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 available only from another source

E: O pacote 'oracle-java7-installer' não tem candidato para instalação
    
asked by anonymous 15.02.2018 / 20:42

1 answer

0

I'm 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 the request returns a 404, so I installed OpenJDK.

To configure / manage the installed java versions use the command:

sudo update-alternatives --config java

the command response will look 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, either as described in the command response, you enter key to keep the current selection, or type the number of the alternative you want it to be the one selected from now on.

    
16.02.2018 / 16:23