como instalar o java JDK e JRE mais recente
faça o download tanto do java jdk quanto do jre de
http://www.oracle.com/technetwork/java/javase/downloads/index.html
expanda para o diretório inicial:
~/jdk*
~/jre*
assim que ambos os diretórios estiverem temporariamente no seu diretório home, basta recortar e colar todos os itens abaixo em um terminal
# ............ TOP of cut N paste >>>>>>>>>>>>>>>>>>>> #
sudo mkdir -p /usr/local/java
cd /usr/local/java
# remove previous installs if any
sudo rm -rf /usr/local/java/jdk*
sudo rm -rf /usr/local/java/jre*
# move downloaded into /usr/local/java
sudo mv ~/jdk* /usr/local/java/
sudo mv ~/jre* /usr/local/java/
cd /usr/local/java/
# create symbolic links
sudo ln -s jdk* jdk
sudo ln -s jre* jre
# ___ ONLY need to do below on fresh ubuntu install - not necessary if previously installed any java version as its already in place
# symlinks :
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jre/bin/javaws" 1
sudo update-alternatives --set java /usr/local/java/jre/bin/java
sudo update-alternatives --set javac /usr/local/java/jdk/bin/javac
sudo update-alternatives --set javaws /usr/local/java/jre/bin/javaws
java -version # run this to verify install worked
# ............ BOTTOM of cut N paste >>>>>>>>>>>>>>>>>>>> #
feito ... confirme que tudo está bem, emitindo
java -version
que deve ser semelhante a
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)