4 Installation of the JDK on Linux Platforms

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

General Notes About Installing the JDK on Linux Platforms

Root Access

This topic describes general information about installing JDK 12 on Linux platforms.

Installing the JDK automatically creates a directory called jdk–12.interim.update.patch.

Note:

If you install Java SE Runtime Environment in a specific location such as /usr/jdk (for JDK) 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 in 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–12.interim.update.patch, 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 installation directory as applicable. If the JDK 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 on Linux Platforms

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

JDK Installation Instruction Notation for Linux Platforms

Instructions for installing either JDK contains a version notation that represents the Feature, Interim, and Update version information.

For example, if you are installing JDK 12 Interim 0, Update 0, and Patch 0, then the following string represents the name of the bundle:

jdk-12.interim.update.patch-linux-x64_bin.tar.gz

This string becomes:
jdk-12-linux-x64_bin.tar.gz

Installing 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 Oracle 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:

JDK can be used to test applications and a separate JRE is not required.

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

Download File Instructions Architecture Who Can Install
jdk-11.interim.update.patch-linux-x64.tar.gz Installing the 64-Bit JDK 12 on Linux Platforms 64-bit Anyone
jdk-11.interim.update.patch-linux-x64.rpm Installing the 64-Bit JDK on RPM-Based Linux Platforms 64-bit RPM-based Linux Root

Installing the 64-Bit JDK 12 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-12.interim.update.patch_linux-x64_bin.tar.gz.

    Before you download a file, you must accept the license agreement. Anyone (not only by root users) can install the archive binary in any location having write access.

    The .tar.gz archive file (also called a tarball) is a file that can be uncompressed and extracted in a single 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-12.interim.update.patch_linux-x64_bin.tar.gz

    The Java Development Kit files are installed in a directory called jdk-12.interim.update.patch.

  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.

Use the sudo command to run the RPM-based installation as a root user.
To install the 64-bit JDK on an RPM-based Linux platform:
  1. Download the file, jdk-12.interim.update.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-12.interim.update.patch_linux-x64_bin.rpm

    Note:

    JDK 12 can coexist with earlier versions of JDK. For each version, a new directory is created, the default directory being /usr/java/jdk-12.interim.update.patch.

    Upgrade the package using the following command:

    $ rpm -Uvh jdk-12.interim.update.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