Hospedagem Profissional

Hospedagem Profissional
Clique aqui e ganhe US$ 10,00 para testar durante 1 mês a melhor hospedagem: Digital Ocean!

terça-feira, 6 de dezembro de 2016

Como instalar o Oracle Java 8 no Linux (Debian) via repositório e receber atualizações automáticas

Este é um ótimo tutorial para quem vive tendo que atualizar manualmente o Java no Linux. Browsers como o Firefox impedem ou dificultam muito a vida de quem precisa acessar bancos por exemplo se o plugin do Java estiver desatualizado. Seguindo as dicas abaixo, após a instalação do Java, o mesmo será atualizado automaticamente.


A quick tip for Debian users who want to install and stay up to date with the latest Oracle Java 8 (JDK8): the WebUpd8 Java 8 PPA works on Debian too since the package is just an installer and all you have to do is manually add the PPA repository to the Software Sources.


As a reminder, the Oracle Java 8 PPA repository does not host any Java files but only an installer that automatically downloads and installs Oracle Java 8, like the flashplugin-installer package for instance.


To add the WebUpd8 Oracle Java PPA repository to the Software Sources in Debian (tested on Debian Squeeze, but it should work with any Debian version), use the following commands:

 su -  
 echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list  
 echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list  
 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886  
 apt-get update  
 apt-get install oracle-java8-installer  
 exit  

And that's it, Oracle Java 8 (both JDK8 and JRE8) should now be installed and you should receive automatic updates with future Oracle Java 8 versions, under Debian.

Setting Java environment variables


To automatically set up the Java 8 environment variables, you can install the following package:

 sudo apt-get install oracle-java7-set-default  

If you've already installed oracle-java6-set-default or oracle-java7-set-default, they will be automatically removed when installing oracle-java7-set-default (and the environment variables will be set for Oracle Java 8 instead).

Fonte: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html