Instalando o java8 no Ubuntu 14.04 [duplicado]

1

Eu estava tentando instalar o java8 na minha máquina 14.04 do Ubuntu. Eu estou recebendo os seguintes erros. Eu tentei muitas soluções disponíveis na internet, mas o erro de floowing está repetindo todas as vezes.

Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-java8-set-default:
 oracle-java8-set-default depends on oracle-java8-installer; however:
  Package oracle-java8-installer is not configured yet.

dpkg: error processing package oracle-java8-set-default (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 oracle-java8-installer
 oracle-java8-set-default
E: Sub-process /usr/bin/dpkg returned an error code (1)

Obrigado antecipadamente ..

    
por Yenumula Sudhir Kumar 11.07.2016 / 16:04

1 resposta

-3

Eu tentei muitas soluções, mas isso funcionou para mim Solução . Eu estou postando isso para que possa ser útil para os outros

Create an empty folder so that we can install java 1.8

sudo mkdir /opt/java && cd /opt/java
Now lets download java-1.8 version



wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz"
Extract the tar file

tar -zxvf jdk-8u45-linux-x64.tar.gz
Now lets update the alternatives so that system will point to the location where java-1.8 is installed

cd jdk1.8.0_45/
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_45/bin/java 100
Note: The 100 in above command represents the priority no.  which can set manually

sudo update-alternatives --config java
    Please enter the selection no. which is having the path as  “/opt/java/jdk1.8.0_45/bin/java” and press enter.

sudo update-alternatives –install /usr/bin/javac javac /opt/java/jdk1.8.0_45/bin/javac 100
sudo update-alternatives –config javac
sudo update-alternatives –install /usr/bin/jar jar /opt/java/jdk1.8.0_45/bin/jar 100
sudo update-alternatives –config jar
Now lets try to set up the environment variables
    
por Yenumula Sudhir Kumar 11.07.2016 / 20:18