How do I download and install Java for various operating systems?
This applies to:
· Platform(s): Oracle Enterprise Linux, Oracle Linux, Red Hat Linux, SLES, SUSE Linux
· Java version(s): 7.0, 8.0
Linux System Requirements
Check supported System Configurations for information on supported platforms, operating systems, desktop managers, and browsers.
Follow the below steps to download and install 32- bit Java for Linux.
- Enable and Configure
Go to http://java.com and click the Download button
There are two types of installation packages.
Java on Linux Platforms
This installs the Java Runtime Environment (JRE) for 32-bit Linux, using an archive binary file (.tar.gz) that can be installed by anyone (not only root users), in any location that you can write on. However, only a root user can install Java into the system location.
Java on RPM-based Linux Platforms
This installs the Java Runtime Environment (JRE) for 32-bit RPM-based Linux platforms, such as Red Hat and SuSE, using an RPM binary file (.rpm) in the system location. You must be a root user to perform this installation.
Download the package that best suits your needs. You can download the file to any of the directories on your system.
You must accept the license agreement to go ahead with the file download
Download and check the download file size to ensure that you have downloaded the full, uncorrupted software bundle. Before you download the file, notice its byte size mentioned in the download page on the web site. Once the download is completed, compare the file size to the size of the downloaded file to make sure they are equal.
- Java for Linux Platforms
- Java for RPM based Linux Platforms
The instructions mentioned below are for installing version Java 8 Update 73 (8u73). In case you are installing another version, make sure you change the version number accordingly when you type the commands at the terminal. Example: For Java 8u79, replace 8u73 with 8u79.
Note: In the above example, the version number is sometimes preceded with the letter u, and sometimes it is preceded with an underbar, for example, jre1.8.0_73.
Note on Root Access: To install Java in a system-wide location such as /usr/local, you must login as a root user to gain the necessary permissions. If you do not have root access, install Java in your home directory or a sub directory for which you have write permissions.
Java for Linux Platforms
Change the directory where you want to install Java
Type: cd directory_path_name
For example, to install the software in the /usr/java/ directory, Type: cd /usr/java/
3. Move the .tar.gz archive binary to the current directory
4. Unpack the tarball and install Java
tar zxvf jre-8u73-linux-i586.tar.gz
The Java files are installed in a directory called jre1.8.0_73 in the current directory
In this example, it is installed in the /usr/java/jre1.8.0_73 directory
5. Delete the .tar.gz file if you want to save disk space
Java for RPM based Linux Platforms
- Become a root user by running su and entering the super-user password
- Uninstall any earlier installations of Java packages
rpm -e package_name
- Change the directory to which you want to install
- Type: cd directory_path_name
For example, to install the software in the /usr/java/ directory, Type: cd /usr/java
- Install the package
rpm -ivh jre-8u73-linux-i586.rpm
To upgrade a package,
rpm -Uvh jre-8u73-linux-i586.rpm
- Exit the root shell. No need to reboot
- Delete the .rpm file if you want to save disk space
The installation is now complete. Go to the Enable and Configure section.
Enable and Configure
When you install the Java platform, a Java plugin file is included as part of the installation. If you want to use Java within Firefox, you need to manually create a symbolic link from the plugin file in the release to one of the locations that Firefox expects. For Firefox version 21 and higher, you must create the symbolic link in your home directory, ~/.mozilla/plugins. Beginning with Firefox version 21, creating a symbolic link from the plugin's subdirectory to Firefox application's directory is not supported.
To configure the Java Plugin follow the below steps:
- Exit the Firefox browser in case it is already running
- Uninstall any previous installations of Java Plugins
Only one Java Plugin can be used at a time. When you want to use a different plugin, or version of a plugin, delete the symbolic links to any other version and create a fresh symbolic link to the new one.
Remove the symbolic links (or move them to another directory) to javaplugin-oji.so and libnpjp2.so from the Firefox plugin's directory.
- Create a symbolic link to the Java Plugin in the Firefox plugin's directory
- Go to the Firefox plugins directory
Create the plugin's directory if it does not exist.
- Create the symbolic link
ln -s Java installation directory/lib/i386/libnpjp2.so .
ln -s Java installation directory/lib/amd64/libnpjp2.so .
- Go to the Firefox plugins directory
- Java is installed in the below directory:
/usr/java/Java installation directory
- Then type in the terminal window to go to the browser plug-in directory:
- Enter the following command to create a symbolic link to the Java Plug-in for Firefox:
ln -s /usr/java/Java installation directory/lib/i386/libnpjp2.so
- Start the Firefox browser, or restart it if it is already up
In Firefox, type about:plugins in the Location bar to confirm that the Java Plugin is loaded. You can also click the Tools menu to confirm that the Java Console is there.