Oracle JDK 8 is NOT installed

Asked

Viewed 811 times

2

Good evening, I’m having trouble installing java8 in umbuntu

I have tried to delete all apt-get I have installed, and reinstall. I’m following this one https://www.digitalocean.com/community/tutorials/como-instalar-o-java-com-apt-get-no-ubuntu-16-04-pt

I reached the point of reinstalling the umbuntu, and in this command

sudo apt-get install oracle-java8-installer

gives the error below

root@henrique-Aspire-5741:~# apt-get install oracle-java8-installer 
Lendo listas de pacotes... Pronto
Construindo árvore de dependências       
Lendo informação de estado... Pronto
oracle-java8-installer is already the newest version (8u201-1~webupd8~1).
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 3 não atualizados.
1 pacotes não totalmente instalados ou removidos.
Depois desta operação, 0 B adicionais de espaço em disco serão usados.
Você quer continuar? [S/n] 
Configurando oracle-java8-installer (8u201-1~webupd8~1) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2019-04-16 20:27:16--  http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
Resolvendo download.oracle.com (download.oracle.com)... 23.52.118.67
Conectando-se a download.oracle.com (download.oracle.com)|23.52.118.67|:80... conectado.
A requisição HTTP foi enviada, aguardando resposta... 302 Moved Temporarily
Localização: https://edelivery.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz [redirecionando]
--2019-04-16 20:27:16--  https://edelivery.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz
Resolvendo edelivery.oracle.com (edelivery.oracle.com)... 23.2.191.58, 2600:1419:0:6a1::366, 2600:1419:0:69f::366
Conectando-se a edelivery.oracle.com (edelivery.oracle.com)|23.2.191.58|:443... conectado.
A requisição HTTP foi enviada, aguardando resposta... 302 Moved Temporarily
Localização: http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz?AuthParam=1555457357_6043b825975efc4efe4e795c46e76390 [redirecionando]
--2019-04-16 20:27:17--  http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz?AuthParam=1555457357_6043b825975efc4efe4e795c46e76390
Conectando-se a download.oracle.com (download.oracle.com)|23.52.118.67|:80... conectado.
A requisição HTTP foi enviada, aguardando resposta... 301 Moved Permanently
Localização: https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz?AuthParam=1555457357_6043b825975efc4efe4e795c46e76390 [redirecionando]
--2019-04-16 20:27:17--  https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz?AuthParam=1555457357_6043b825975efc4efe4e795c46e76390
Conectando-se a download.oracle.com (download.oracle.com)|23.52.118.67|:443... conectado.
A requisição HTTP foi enviada, aguardando resposta... 404 Not Found
2019-04-16 20:27:22 ERRO 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
dpkg: erro ao processar o pacote oracle-java8-installer (--configure):
 installed oracle-java8-installer package post-installation script subprocess returned error exit status 1
Erros foram encontrados durante o processamento de:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

a strange thing is that any apt-get that I try to install from Oracle JDK 8 is NOT installed error. For example a sudo apt-get install vim

when I give a java -version

openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Ubuntu-3ubuntu118.10.3)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Ubuntu-3ubuntu118.10.3, mixed mode, sharing)
  • Try to run these commands sudo rm /var/lib/dpkg/info/oracle-java8-installer.postinst -f sudo dpkg --configure oracle-java8-installer

  • tried unsuccessfully

2 answers

1


The most uncomplicated way to get Java (and other things related to the JVM ecosystem like Maven, Gradle, Springboot, Kotlin, Scala and etc) into a Linux distribution is by using the sdkman

To perform the installation of the same, just type:

curl -s "https://get.sdkman.io" | bash

After installation:

source "$HOME/.sdkman/bin/sdkman-init.sh"

Once done, just install the version (8,9,10...) desired of Java (Oracle, Zulu, Openjdk, Amazon and etc). To consult the available types just type

sdk list java

inserir a descrição da imagem aqui

To choose the version to be installed, just type:

sdk install java "versão desejada"

After installation, sdkman will ask if you want to set to Default... You put Yes[Y]. To export JDK for use on other Ides, I suggest creating a JAVA_HOME variable

JAVA_HOME="$HOME/.sdkman/candidates/java/current"
export JAVA_HOME

Once done, just restart the shell and use as you wish:

0

Looks like the installer hasn’t been updated yet. You can try downloading directly from the oracle repository, try these commands:

cd /var/lib/dpkg/info
sudo sed -i 's|JAVA_VERSION=8u181|JAVA_VERSION=8u191|' oracle-java8-installer.*
sudo sed -i 's|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/|PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/|' oracle-java8-installer.*
sudo sed -i 's|SHA256SUM_TGZ="1845567095bfbfebd42ed0d09397939796d05456290fb20a83c476ba09f991d3"|SHA256SUM_TGZ="53c29507e2405a7ffdbba627e6d64856089b094867479edc5ede4105c1da0d65"|' oracle-java8-installer.*
sudo sed -i 's|J_DIR=jdk1.8.0_181|J_DIR=jdk1.8.0_191|' oracle-java8-installer.*

Read more about in: https://ubuntuforums.org/showthread.php?t=2374686&p=13699352#post13699352

  • https://stackoverflow.com/questions/32758465/ubuntu-oracle-jdk-8-is-not-installed

  • There are several similar questions, the most complete one I found was this: https://stackoverflow.com/questions/43587635/dpkg-error-processing-package-oracle-java8-installer-configure

  • yes, this link that I posted already tried all solutions presented but without success, I find it very strange is that the 4 links that he tries to access for download do not work, the first 3 give access denied and the last not found, so I tried to download manually and install manually, but msm error it tries to download and I already installed it manually

Browser other questions tagged

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