O Java 6 não é mais suportado pelo Oracle (algumas atualizações ainda estão disponíveis por meio do programa Java SE Support, mas isso não está disponível publicamente - de Wikipedia ). Instale o Java 8 ou mais recente em seu lugar.
Estou tentando instalar o oracle-java6-installer no ubuntu 16.04.
E eu instalo com os passos abaixo.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
Mas eu vou pegar esse erro abaixo.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core
ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho | ttf-
sazanami-mincho ttf-arphic-uming
The following NEW packages will be installed:
oracle-java6-installer
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/21.0 kB of archives.
After this operation, 209 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package oracle-java6-installer.
(Reading database ... 215570 files and directories currently
installed.)
Preparing to unpack .../oracle-java6-installer_6u45-
0~webupd8~8_all.deb ...
oracle-license-v1-1 license has already been accepted
Unpacking oracle-java6-installer (6u45-0~webupd8~8) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-
0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2ubuntu0.1) ...
Setting up oracle-java6-installer (6u45-0~webupd8~8) ...
Downloading Oracle Java 6...
--2018-04-19 09:46:17-- http://download.oracle.com/otn-
pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin
Resolving download.oracle.com (download.oracle.com)... 23.53.64.147
Connecting to download.oracle.com
(download.oracle.com)|23.53.64.147|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-
6u45-linux-x64.bin [following]
--2018-04-19 09:46:17-- https://edelivery.oracle.com/otn-
pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin
Resolving edelivery.oracle.com (edelivery.oracle.com)...
104.116.18.92, 2600:1417:1b:184::2d3e, 2600:1417:1b:188::2d3e
Connecting to edelivery.oracle.com
(edelivery.oracle.com)|104.116.18.92|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-
6u45-linux-x64.bin?
AuthParam=1524102497_fa8d9de89ff9d81e73b656b883c0b633 [following]
--2018-04-19 09:46:17-- http://download.oracle.com/otn-
pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin?
AuthParam=1524102497_fa8d9de89ff9d81e73b656b883c0b633
Connecting to download.oracle.com
(download.oracle.com)|23.53.64.147|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-04-19 09:46:18 ERROR 404: Not Found.
download failed
Oracle JDK 6 is NOT installed.
dpkg: error processing package oracle-java6-installer (--configure):
subprocess installed post-installation script returned error exit
status 1
Errors were encountered while processing:
oracle-java6-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
Como posso resolver este problema?
O openjdk-6-jdk não tem um candidato de instalação no Ubuntu 16.04 e posterior. Em vez disso, recomenda-se instalar o openjdk-8-jdk a partir do terminal com o comando:
sudo apt install openjdk-8-jdk
O Java 6 ainda está disponível no arquivo do Java SE 6 Downloads página do site oficial da Oracle. Selecione o arquivo .tar.gz que atualmente é denominado jdk-6u45-linux-x64.bin (para arquitetura de 64 bits) ou jdk-6u45-linux-i586.bin (para arquitetura de 32 bits). A Oracle fornece este aviso de que os pacotes nos pacotes do Oracle Java Archive não são mais atualizados com os patches de segurança mais recentes.
These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production.
Download the jdk-6u45-linux-x64.bin file. If you have a 32-bit Ubuntu installation, download jdk-6u45-linux-i586.bin instead.
Make the downloaded bin file executable.
chmod +x jdk-6u45-linux-x64.bin
Extract the bin file.
./jdk-6u45-linux-x64.bin
Using the following command create a folder called "jvm" inside
/usr/lib
if it does not already exist.sudo mkdir /usr/lib/jvm
Move the extracted folder into the newly created jvm folder.
sudo mv jdk1.6.0_45 /usr/lib/jvm/
To install the Java source run the following commands.
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1 sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
To make this default java:
sudo update-alternatives --config javac sudo update-alternatives --config java sudo update-alternatives --config javaws
To make symlinks point to the new Java location run the following command.
ls -la /etc/alternatives/java*
To verify Java has installed correctly run this command.
java -version
Revisado de: Instalando o Oracle Java 6 no Ubuntu