java -version
Check the latest version a build numbers in http://www.oracle.com/technetwork/java/javase/downloads/index.html
For url http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz, the variables should be defined as:
java_base_version="8"
java_sub_version="11"
java_base_build="14"
java_version="${java_base_version}u${java_sub_version}"
java_build="b${java_base_build}"
java_version_with_build="${java_version}-${java_build}"
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/${java_version_with_build}/jdk-${java_version}-linux-x64.rpm"
sudo rpm -i jdk-${java_version}-linux-x64.rpm
java -version
sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.${java_base_version}.0_${java_sub_version}/bin/java 20000
sudo /usr/sbin/alternatives --config java
java -version
export JAVA_HOME=/usr/java/default
I am getting following output after executing below command.
wget --no-cookies --header "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" "http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm"
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm?AuthParam=1594561344_c05993b0def6cd0fb7206876e1b671a9 [following]
--2020-07-12 13:40:24-- https://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm?AuthParam=1594561344_c05993b0def6cd0fb7206876e1b671a9
Connecting to download.oracle.com (download.oracle.com)|184.87.216.29|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-07-12 13:40:24 ERROR 404: Not Found.