Oracle has special mechanism to download files from them. I wrote just wget and download link. It did not download the full file.

Solution is to click through their site with accepting licence or to write wget like this:

 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/8u112-b15/jdk-8u112-linux-x64.rpm"

After that you can install java with yum:

 yum install jdk-8u112-linux-x64.rpm
Answer from Waldemar WosiΕ„ski on Stack Exchange
🌐
Oracle
java.com β€Ί en β€Ί download β€Ί help β€Ί linux_x64rpm_install.html
Linux 64-bit RPM Java installation instructions
Uninstall any earlier installations of the Java packages. ... Install the package. rpm -ivh jre-8u73-linux-x64.rpm To upgrade a package: rpm -Uvh jre-8u73-linux-x64.rpm
🌐
Oracle
oracle.com β€Ί java β€Ί technologies β€Ί java se
JDK RPM 64-bit Installation
This procedure installs the Java Development Kit (JDK) for 64-bit Linux, using an RPM binary bundle. Some Linux distributions, such as Ubuntu, are not RPM-based.
🌐
Oracle
oracle.com β€Ί java β€Ί technologies β€Ί downloads
Download the Latest Java LTS Free
This license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. FAQs are available here. Commercial license and support are available for a low cost with Java SE Universal Subscription. JDK 17.0.19 checksums and OL 9 GPG Keys for RPMs
🌐
Adoptium
adoptium.net β€Ί installation β€Ί linux
Linux (RPM/DEB/APK) installer packages | Adoptium
java -version Β· You can also confirm installed packages with: rpm -qa | grep temurin Β· Import the RPM repo as follows. RPM’s are also available for SLES 12 and 15.
🌐
Oracle
java.com β€Ί en β€Ί download β€Ί help β€Ί linux_rpm.html
What are the options for Java installed through RPM?
Type: rpm -Uvh <package-file> For example: for upgrade to Java 1.7.0, type: rpm -Uvh jre1.7.0 The vh options are used to provide the user with feedback during the installation process.
Find elsewhere
🌐
CrossWire Bible Society
crosswire.org β€Ί jsword β€Ί linuxjava.html
Obtain and Install Java for Linux
The situation regarding Java is changing fast. Sun has opened sourced Java, but not all of it, nor all versions of it (Sun's Java 1.5.0 is still proprietary and not open source). Some Linux distributions now have a version of Sun's java that will run BibleDesktop.
🌐
Oracle
java.com β€Ί en β€Ί download β€Ί help β€Ί download_options.html
How do I install Java ?
Java on Linux Platforms This is an archive binary file that can be installed by anyone (not only the root users), in any location that you can write to. However, only the root user can install Java into the system location. Java on RPM-based Linux Platforms 32-bit RPM-based Linux platforms, such as Red Hat and SuSE, use a RPM binary file (.rpm) in the system location.
🌐
Oracle
oracle.com β€Ί java β€Ί technologies β€Ί javase-install-linux-rpm-32.html
JDK RPM 32-bit Installation | Oracle
This procedure installs the Java SE Runtime Environment for 32-bit Linux, using an RPM binary bundle. Some Linux distributions, such as Ubuntu, are not RPM-based.
🌐
Oracle
oracle.com β€Ί java β€Ί technologies β€Ί javase-install-linux-rpm.html
JRE RPM 32-bit Installation | Oracle
This procedure installs the Java SE Runtime Environment for 32-bit Linux, using an RPM binary bundle. Some Linux distributions, such as Ubuntu, are not RPM-based.
🌐
IBM
ibm.com β€Ί docs β€Ί en β€Ί sdk-java-technology β€Ί 8
Installing from an RPM package (Linux only)
The RPM Package Manager installer packages are available as standard .rpm files, which can be installed interactively from the command line.
🌐
DigitalOcean
digitalocean.com β€Ί community β€Ί tutorials β€Ί how-to-install-java-on-centos-and-fedora
How To Install Java on CentOS, Rocky Linux, RHEL, and Fedora | DigitalOcean
March 18, 2022 - This tutorial will show you how to install Java on current versions of RPM-based Linux distributions: Red Hat Enterprise Linux, CentOS, Fedora, and Rocky Linux.
🌐
The Geek Stuff
thegeekstuff.com β€Ί 2017 β€Ί 06 β€Ί java-8-jre-jdk-install
How to Install Java 8 JRE and JDK from RPM file on Linux
June 21, 2017 - # java -version -bash: java: command not found # rpm -qa | grep -i jre Β· Install the downloaded jre rpm file as shown below.
Top answer
1 of 2
6

RPM is Redhat, Fedore, CentOS so unusable.

You need, preferably, a DEB version or otherwise the tar.gz version.

I would advicw to use a personal archive as explained here:http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html

Install method for java 7:

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-java7-installer
exit

You can then install this...

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

"To automatically set up the Java 7 environment variables"

2 of 2
1

Use the Java for Linux Platforms. Here are the download instructions There is a similar question on how to install JDK 7

Install the JRE

Download the 32bit or 64bit Linux "compressed binary file" - it has a ".tar.gz" file extension and uncompress it

tar -xvf jre-7-linux-i586.tar.gz

JRE 7 package is extracted into ./jre1.7.0 directory. Now move the JRE 7 directory to /usr/lib

sudo mv ./jre1.7.0* /usr/lib/jvm/jre1.7.0

Afterwards run the following to get a list of currently installed java alternatives

sudo update-alternatives --config java

You will get output as:

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

Press enter to keep the current choice[*], or type selection number:

Remember the last number and press enter to exit this utility i.e. in this example remember the number 2.

If only one alternative is shown then remember the number 0

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 3

This will add your new JRE 7 installation into alternatives list i.e. use the remembered number + 1 i.e. 3 in the example above. Now configure java to use the Oracle Java JRE

sudo update-alternatives --config java

You will see output similar one below - choose the number of jre1.7.0 i.e. 3:

There are 3 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
3 /usr/lib/jvm/jre1.7.0/jre/bin/java 3 manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/jre1.7.0/jre/bin/java to provide /usr/bin/java (java) in manual mode.

N.B. if there was no previous java installation then the new JRE will be the default and you will not see the above.

Check the version of you new JRE 7 installation:

java -version

Should produce

java version β€œ1.7.0”
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode) 

Install the Firefox/Chrome plugin

In a terminal:

mkdir ~/.mozilla/plugins

Remove the IcedTea plugin, if it has been installed.

sudo apt-get remove icedtea6-plugin

Remove a former version of the Java plugin (may or may not be present)

rm ~/.mozilla/plugins/libnpjp2.so

Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located). For 32bit java use

ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/

For 64bit java use

ln -s /usr/lib/jvm/jre1.7.0/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Confirm that the JRE has been successful by using the official oracle website.

SOURCE: How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?

🌐
Opensource.com
opensource.com β€Ί article β€Ί 19 β€Ί 11 β€Ί install-java-linux
How to install Java on Linux | Opensource.com
For Fedora, CentOS, RHEL, and similar, download the RPM and install it using DNF: ... For Debian, Ubuntu, Pop_OS, and similar distributions, download the DEB package and install it using Apt: ... Java is now installed.