5 Installation of the JDK and JRE on Linux Platforms

This topic describes the installation procedures of the JDK and JRE on the Linux platform, along with the system requirements.

General Notes About Installing the JDK and JRE on Linux Platforms

This topic describes general information about installing JDK and JRE 9 on Linux platforms.

Root Access

Installing the JDK automatically creates a directory called jdk–9.minor.security.patch. For the JRE, the software automatically creates a directory called jre–9.minor.security.patch .

Note:

If you install Java SE Runtime Environment in a specific location such as /usr/jdk (for JDK) or /usr/jre (for JRE), then you must log in with root credentials to gain the necessary permissions. If you do not have root access, then either install the Java SE Runtime Environment into your home directory or a subdirectory for which you have write permissions.

Overwriting Files

If you install the software in a directory that contains a subdirectory named jdk–9.minor.security.patch (for JDK) or jre–9.minor.security.patch (for JRE), then the new software overwrites files of the same name in that directory. Ensure that you rename the old directory if it contains files that you would like to keep.

System Preferences

By default, the installation script configures the system such that the backing store for system preferences is created inside the JDK or JRE's installation directory as applicable. If the JDK or JRE is installed on a network-mounted drive, then the system preferences can be exported for sharing with Java runtime environments on other machines.

System Requirements for Installing JDK and JRE on Linux Platforms

See Oracle JDK 9 and JRE 9 Certified Systems Configurations for information about supported platforms, operating systems, and browsers.

On a 64-bit system, you can download either the 64-bit or the 32-bit version of the Java platform. However, if you are using a 32-bit browser and you want to use the Java plug-in, then you need to install the 32-bit version of the Java platform.

To determine which version of Firefox that you are running, start the application. In the menu , click Help and select About Firefox. The version number is listed below the Firefox name, for example 43.2.0.

To set up the Java plug-in, see Manual Installation and Registration of the Java Plug-in on Linux.

JDK and JRE Installation Instruction Notation for Linux Platforms

Instructions for installing either JDK or JRE contains a version notation that represents the Major, Minor, and Security version information.

For example, if you are installing JDK 9 Minor 1, Security 1, and Patch 1, then the following string represents the name of the bundle:

jdk-9.minor.security.patch-linux-x86_bin.tar.gz

This string becomes:
jdk-9.1.1.1-linux-i586.tar.gz

Installation of the JDK on Linux from Archive Binaries and RPM Packages

You can install the Java Development Kit (JDK) on a Linux platform from archive binary files or from Red Hat Package Manager (RPM) packages.

Installation can be performed by using one of the following processes:

  • From archive binaries (.tar.gz): This allows you to install a private version of the JDK for the current user into any location, without affecting other JDK installations. However, it may involve manual steps to get some of the features to work. See the following table for the options available for downloading and installing the JDK from archive binaries.

  • From RPM packages (.rpm): This allows you to perform a systemwide installation of the JDK for all users, and requires root access. RPM-based Linux platforms are based on Red Hat and SuSE. See the following table for the options available for downloading and installing the JDK from RPM packages.

Note:

When you download and install the JDK, the associated Java Runtime Environment (JRE) is also installed.

The following table lists the options and instructions for downloading and installing the JDK 9 release on a Linux platform:

Download File Instructions Architecture Who Can Install
jdk-9.minor.security.patch-linux-x64.tar.gz Installing the 64-Bit JDK 9 on Linux Platforms 64-bit Anyone
jdk-9.minor.security.patch-linux-x86.tar.gz Installing the 32-Bit JDK on Linux Platforms 32-bit Anyone
jdk-9.minor.security.patch-linux-x64.rpm Installing the 64-Bit JDK on RPM-Based Linux Platforms 64-bit RPM-based Linux Root
jdk-9.minor.security.patch-linux-x86.rpm Installing the 32-Bit JDK on RPM-Based Linux Platforms 32-bit RPM-based Linux Root

Installing the 64-Bit JDK 9 on Linux Platforms

You can install the JDK for 64-bit Linux, from an archive binary file (.tar.gz).

To install the 64-bit JDK on a Linux platform:
  1. Download the file, jdk-9.minor.security.patch_linux-x64_bin.tar.gz.

    Before you download a file, you must accept the license agreement. The archive binary can be installed by anyone (not only by root users) in any location that you can write to.

    The .tar.gz archive file (also called a tarball) is a file that can be simultaneously uncompressed and extracted in one step.

  2. Change the directory to the location where you want to install the JDK, then move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install the JDK:

    % tar zxvf jdk-9.minor.security.patch_linux-x64_bin.tar.gz

    The Java Development Kit files are installed in a directory called jdk-9.minor.security.patch in the current directory.

  4. Delete the .tar.gz file if you want to save disk space.

Installing the 64-Bit JDK on RPM-Based Linux Platforms

You can install the JDK on 64-bit RPM-based Linux platforms, such as Red Hat and SuSE, by using an RPM binary file (.rpm) in the system location.

You must log in as a root user to perform this installation.
To install the 64-bit JDK on an RPM-based Linux platform:
  1. Download the file, jdk-9.minor.security.patch_linux-x64_bin.rpm.

    Before you download a file, you must accept the license agreement.

  2. Ensure that you have root user access by running the command su and entering the superuser password.
  3. Install the package using the following command:

    # rpm -ivh jdk-9.minor.security.patch_linux-x64_bin.rpm

    Note:

    JDK 9 can coexist with earlier versions of JDK. For each version, a new directory is created, the default directory being /usr/java/jdk.minor.security.patch.

    Upgrade the package using the following command:

    # rpm -Uvh jdk-9.minor.security.patch_linux-x64_bin.rpm

  4. Delete the .rpm file if you want to save disk space.
  5. Exit the root shell.
    It is not required to reboot.

The JDK installation is integrated with the alternatives framework. After installation, the alternatives framework is updated to reflect the binaries from the recently installed JDK. Java commands such as java, javac, javadoc, and javap can be called from the command line.

Using the java -version command, users can confirm the default (recently installed) JDK version.

In addition, users can check which specific RPM package provides the .java files:

rpm -q --whatprovides java

Installing the 32-Bit JDK on Linux Platforms

You can install the Java Development Kit (JDK) for 32-bit Linux, from an archive binary file (.tar.gz).

To install JDK 9 on 32-bit Linux platforms:
  1. Download the file, jdk-9.minor.security.patch_linux-x86_bin.tar.gz.

    Before downloading a file, you must accept the license agreement. The archive binary can be installed by anyone (not only root users) in any location that you can write to. However, only the root user can install the JDK into the system location.

    The .tar.gz archive file (also called a tarball) is a file that can be simultaneously uncompressed and extracted in one step.

  2. Change the directory to the location where you want to install the JDK, then move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install the JDK using the following command:

    % tar zxvf jdk-9.minor.security.patch_linux-x86_bin.tar.gz

    The Java Development Kit files are installed in a directory called jdk-9.minor.security.patch in the current directory.

  4. Delete the .tar.gz file if you want to save disk space.

Installing the 32-Bit JDK on RPM-Based Linux Platforms

You can install the JDK for 32-bit RPM-based Linux platforms, such as Red Hat and SuSE, from an RPM binary file (.rpm) in the system location.

You must log in as a root user to perform this installation.
To install the 32-bit JDK on an RPM-based Linux platform:
  1. Download the file, jdk-9.minor.security.patch_linux-x86_bin.rpm.

    Before downloading a file, you must accept the license agreement.

  2. Ensure that you have root user access by running the command su and entering the superuser password.
  3. Uninstall any earlier installations of the JDK packages using the following command:

    # rpm -e package_name

  4. Install the package using the following command:

    # rpm -ivh jdk-9.minor.security.patch_linux-x86_bin.rpm

    Upgrade the package using the following command:

    # rpm -Uvh jdk-9.minor.security.patch_linux-x86_bin.rpm

  5. Delete the .rpm file if you want to save disk space.
  6. Exit the root shell. It is not required to reboot.

Starting with version 8u40, the JDK installation is integrated with the alternatives framework. After installation, the alternatives framework is updated to reflect the binaries from the recently installed JDK. Java commands such as java, javac, javadoc, and javap can be called from the command line.

Using the java -version command, users can confirm the default (recently installed) JDK version.

In addition, users can check which specific RPM package provides the .java files by entering:

rpm -q --whatprovides java

Installation of the JRE on Linux from Archive Binaries and RPM Packages

You can install the Java Runtime Environment (JRE) on a Linux platform from archive binary files or from RPM packages.

Use one of the following processes to install JRE:

  • From archive binaries (.tar.gz): This allows you to install a private version of the JRE for the current user into any location, without affecting other JRE installations. However, it may involve manual steps to get some of the features to work. See the following table for the options available for downloading and installing the JRE from archive binaries.

  • From RPM packages (.tar.gz): This allows you to perform a systemwide installation of the JRE for all users using root access. RPM-based Linux platforms are based on Red Hat and SuSE. See the following table for the options available for downloading and installing the JRE from RPM packages.

Note:

When you download and install the Java Development Kit (JDK), the associated JRE is also installed.

The following table lists the options and instructions for downloading and installing the JRE on a Linux platform.

Download File Instructions Architecture Who Can Install
jre-9.minor.security.patch_linux-x64_bin.tar.gz Installing the 64-Bit JRE 9 on Linux Platforms 64-bit Anyone
jre-9.minor.security.patch_linux-x86_bin.tar.gz Installing the 64-Bit JRE 9 on RPM-Based Linux Platforms 32-bit Anyone
jre-9.minor.security.patch_linux-x64.rpm Installing the 32-Bit JRE on Linux Platforms 64-bit RPM-based Linux Root
jre-9.minor.security.patch_linux-x86_bin.rpm Installing the 32-Bit JRE on RPM-Based Linux Platforms 32-bit RPM-based Linux Root

Installing the 64-Bit JRE 9 on Linux Platforms

You can install JRE 9 on a 64-bit Linux platform from an archive binary file (.tar.gz).

To install the 64-bit JRE 9 on a Linux Platform:
  1. Download the file, jre-9.minor.security.patch_linux-x64_bin.tar.gz.

    Before downloading a file, you must accept the license agreement. The archive binary can be installed by anyone (not only root users) in any location that you can write to.

    The .tar.gz archive file (also called a tarball) is a file that can be simultaneously uncompressed and extracted in one step.

  2. Change the directory to the location where you want the JRE to be installed, then move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install the JRE using the following command:

    % tar zxvf jre-9.minor.security.patch_linux-x64_bin.tar.gz

    The Java Development Kit files are installed in a directory called jre-9.minor.security.patch.

  4. Delete the .tar.gz file if you want to save disk space.

Installing the 64-Bit JRE 9 on RPM-Based Linux Platforms

You can install JRE 9 on 64-bit RPM-based Linux platforms, such as Red Hat and SuSE, using an RPM binary file (.rpm) in the system location.

You must have root user privileges to install the JRE.
To install the 64-bit JRE on RPM-based Linux platforms:
  1. Download the file, jre-9.minor.security.patch_linux-x64_bin.rpm.

    Before you download a file, you must accept the license agreement.

  2. Ensure that you have root user access by running the command su and entering the superuser password.
  3. Uninstall all earlier installations of JRE packages using the following command:

    # rpm -e package_name

  4. Install the package using the following command:

    # rpm -ivh jre-9.minor.security.patch_linux-x64_bin.rpm

    Upgrade a package using the following command:

    # rpm -Uvh jre-9.minor.security.patch_linux-x64_bin.rpm

  5. Delete the .rpm file if you want to save disk space.
  6. Exit the root shell. Reboot is not required.

Installing the 32-Bit JRE on Linux Platforms

You can install JRE 9 for 32-bit Linux, from an archive binary file (.tar.gz).

To install JRE 9 on 32-bit Linux platforms:
  1. Download the file, jre-9.minor.security.patch_linux-x86_bin.tar.gz.

    Before downloading a file, you must accept the license agreement. The archive binary can be installed by anyone (not only root users) in any location that you can write to. However, user having the root access can install the JRE into the system location.

    The .tar.gz archive file (also called a tarball) is a file that can be simultaneously uncompressed and extracted in one step.

  2. Change the directory to the location where you want to install the JRE, then move the .tar.gz archive binary to the current directory.
  3. Unpack the tarball and install the JRE using the following command:

    % tar zxvf jre-9.minor.security.patch_linux-x86_bin.tar.gz

    The Java Development Kit files are installed in a directory called jre-9.minor.security.patch.

  4. Delete the .tar.gz file if you want to save disk space.

Installing the 32-Bit JRE on RPM-Based Linux Platforms

You can install JRE 9 for 32-bit RPM-based Linux platforms, such as Red Hat and SuSE, from an RPM binary file (.rpm) in the system location.

You must have root user privileges to perform this installation.
To install the 32-bit JRE on an RPM-based Linux platform:
  1. Download the file jre-9.minor.security.patch_linux-x86_bin.rpm.

    Before downloading a file, you must accept the license agreement.

  2. Ensure that you have root user access by running the command su and entering the superuser password.
  3. Uninstall any earlier installations of the JRE packages using the following command:

    # rpm -e package_name

  4. Install the package using the following command:

    # rpm -ivh jre-9.minor.security.patch_linux-x86_bin.rpm

    Upgrade a package using the following command:

    # rpm -Uvh jre-9.minor.security.patch_linux-x86_bin.rpm

  5. Delete the .rpm file if you want to save disk space.
  6. Exit the root shell.
    Reboot is not required.