A short easy to understand step by step Tutorial on how to download and install Oracle's Java 8 jdk on Ubuntu/Linux using a Terminal.
Note: The Java Version might change in the future, please make sure you update the version number in every command line. For example 1.8.0_112 to 1.8.0_115 or 8u112 to 8u115
1. Step - Download
Note: You may change the link to match newer versions
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" ht[//remove\\]tp://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz
(remove placeholder, youtube likes to shorten links...)
2. Step - Unpacking .tar.gz file
tar -xvzf jdk-8u112-linux-x64.tar.gz
3. Step Creating Java 8 Installation Directory
sudo mkdir /opt/Oracle_Java
sudo mv jdk1.8.0_112/ /opt/Oracle_Java/
4. Step Installing Java 8
(execute one by one)
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/Oracle_Java/jdk1.8.0_112/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/Oracle_Java/jdk1.8.0_112/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/Oracle_Java/jdk1.8.0_112/bin/javaws" 1
sudo update-alternatives --install "/usr/bin/jar" "jar" "/opt/Oracle_Java/jdk1.8.0_112/bin/jar" 1
sudo update-alternatives --set "java" "/opt/Oracle_Java/jdk1.8.0_112/bin/java"
sudo update-alternatives --set "javac" "/opt/Oracle_Java/jdk1.8.0_112/bin/javac"
sudo update-alternatives --set "javaws" "/opt/Oracle_Java/jdk1.8.0_112/bin/javaws"
sudo update-alternatives --set "jar" "/opt/Oracle_Java/jdk1.8.0_112/bin/jar"
Ещё видео!