Downloading and installing Java is easy and free. There are a couple ways by which you can get Java for Windows
Online download
Offline download
Online
Manual installation downloads an IFTW (Install From The Web) executable program file and requires minimum user intervention. When you run this program, it fetches all the required files from the web, so you must remain connected to the Internet during the installation.
Administrative permission is required in order to install Java on Microsoft Windows.
If you face difficulty using the online download option, try the offline download option.
Offline installation requires you to download an executable file available at the manual Java download page, which includes all the files needed for the complete installation at the user's discretion. There is no need to remain connected to the Internet during the installation. The file can also be copied to and installed on another computer that is not connected to the Internet.
Administrative permission is required in order to install Java on Microsoft Windows.
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. You must be root to perform this installation.