3 Installation of JDK and JRE on Oracle Solaris

This topic includes the following sections:

System Requirements for Installing the JDK and JRE on Oracle Solaris

The Server JRE 10 is supported on the Oracle Solaris SPARC (64-bit), version 11 or later.

For supported processors and browsers, see Oracle JDK Certified Systems Configurations.

JDK and JRE Installation Instruction Notation for Oracle Solaris

Instructions for installing either the JDK or JRE contain the interim.update.patch notation that represents the update version number.

For JDK and JRE installation instructions that contain the notation interim.update.patch, substitute the appropriate update version number. For example, if you are installing JDK 10, Interim 0, Update 2, and Patch 1, then the following string represents the name of the bundle:

JDK-10.interim.update.patch_solaris-sparcv9_bin.tar.gz

This string becomes:

JDK-10.0.2.1_solaris-sparcv9_bin.tar.gz

If you are installing JRE 10, Interim 0 and Update 2, and Patch 0, then the following string represents the name of the bundle:

jre-10.interim.update.patch_solaris-sparcv9_bin.tar.gz

This string becomes:

jre-10.0.2_solaris-sparcv9_bin.tar.gz

Installation of JDK on Oracle Solaris from Archive Binaries

You can install JDK 10 on an Oracle Solaris platform from archive binaries (.tar.gz) and Image Packaging System (IPS), which is the Solaris Update Repository.

The following list provides details about the download bundle:
  • Download File: jdk-10.interim.update.patch_solaris-sparcv9_bin.tar.gz

  • Architecture: 64-bit SPARC

  • Who Can Install: Anyone

The installation instructions for using these files are organized by the .tar.gz file type. This technique allows you to install a private version of the JDK for the current user in any location without affecting other JDK installations. However, it involves manual steps to get some features to work.

Note:

See Installing JDK on Oracle Solaris 11 from IPS Packages for the recommended approach.

Installing JDK on Oracle Solaris from Archive Binaries

You can install the JDK archive binary in any location that you can write to. It does not replace the system version of the Java platform provided by the Oracle Solaris OS.
To install JDK from archive binaries (.tar.gz) on Oracle Solaris:
  1. Download the bundle.

    Ensure that you accept the license agreement before downloading the file. The archive binaries can be installed by anyone in any location that you can write to.

    You can simultaneously uncompress and extract the .tar.gz archive file (also called a tarball) in one step.

  2. Change the directory to the location where you want the JDK to be installed.
  3. Move the .tar.gz archive binaries to the current directory.
  4. Unpack the tarball and install the JDK on SPARC processor:
    $ gzip -dc jdk-10.interim.update.patch_solaris-sparcv9_bin.tar.gz | tar xf -
    

    The JDK is installed in a directory called jdk–10.interim.update.patch in the current directory. For example, the directory for the JDK 10 Interim 0, Update 1, and Patch 0 is named:

    jdk-10.0.1.

    The JDK documentation is a separate download. See Java SE Downloads.

Installing JDK on Oracle Solaris 11 from IPS Packages

You can install JDK 10 on Oracle Solaris by using an IPS package.

To install JDK 10 on Oracle Solaris 11 by using the jdk-10 package:
  1. Ensure that the jdk-10 package is available from your IPS publisher.
    For example:

    $ pkg list -a jdk-10

    Name (Publisher) Version IFO
    developer/java/jdk-10 10.1.8.0.0-0.183.0.0.0.0.0 i---
    • Name: the name of the package. If the publisher from which the package is installed (or available) is not the first in the publisher search order, then the publisher name is listed in parentheses after the package name.

    • Version: the release and branch versions of the package.

    • IFO:

      the set of flags that display the status of the package:
      • i in the I column implies that the package is installed.

      • f in the F column implies that the package is frozen.

      • o in the O column implies that the package is obsolete.

      • r in the O column implies that the package has been renamed.

    This package is available from the Oracle Solaris publisher at pkg.oracle.com and also from other publisher origins. If you see a message that no such package is found, then use the pkg publisher command to check your publisher origin and contact your system administrator or Oracle Support representative.

  2. Ensure that you have permission to install IPS packages:
    • Use the profiles command to list the rights profiles that are assigned to you. If you have the Software Installation rights profile, then you can use the pfexec command to install and update packages.

      $ pfexec pkg install jdk-10
      

      Other rights profiles also provide installation privileges, such as the System Administrator rights profile.

    • Depending on the security policy at your site, you might be able to use the sudo command with your user password to execute a privileged command:

      $ sudo pkg install jdk-10
      
    • Use the roles command to list the roles that are assigned to you. If you have the root role, you can use the su command with the root password to assume the root role:

      $ pkg install jdk-10
      

      Note:

      The JDK 10 installation from the SVR4 package (through the pkgadd command) is not supported. Install JDK 10 using the IPS package.

Installing the JRE on Oracle Solaris from Archive Binaries

You can install a JRE 10 archive binary in any location that you can write to. The installation does not replace the system version of the Java platform provided by the Oracle Solaris OS.

To install the JRE 10 on Oracle Solaris from archive binaries (.tar.gz):
  1. Download the bundle.
    • Download File: jre-10.interim.update.patch_solaris-sparcv9_bin.tar.gz

    • Architecture: 64-bit SPARC

    • Who Can Install: Anyone

    Ensure that you accept the license agreement before downloading the file. The archive binaries can be installed by anyone in any location that you can write to.

    You can simultaneously uncompress and extract the .tar.gz archive file (also called a tarball) in one step.

  2. Change the directory to the location where you want the JRE to be installed.
  3. Move the .tar.gz archive binaries to the current directory.
  4. Unpack the tarball and install the JRE on SPARC processor:
    $ gzip -dc jre-10.interim.update.patch_solaris-sparcv9_bin.tar.gz | tar xf -
    

    The JRE is installed in a directory called jre-10.interim.update.patch in the current directory. For example, the directory for the JRE 10, Interim 0, Update 2, and Patch 0 is named:

    jre-10.0.2.

Installing the JRE on Oracle Solaris 11 from IPS Packages

You can install JRE 10 on Oracle Solaris by using an IPS package.

To install JRE 10:
  1. Ensure that the jre-10 package is available from your IPS publisher.
    For example:

    $ pkg list -a jre-10

    Name (Publisher) Version IFO
    developer/java/jre-10 10.1.8.0.0-0.183.0.0.0.0.0 i---

    If you see an i in the I column, then the package is already installed.

    This package is available from the Oracle Solaris publisher at pkg.oracle.com and also from other publisher origins. If you see a message that no such package is found, then use the pkg publisher command to check your publisher origin, and contact your system administrator or Oracle Support representative.

  2. Ensure that you have permission to install IPS packages.
    • Use the profiles command to list the rights profiles that are assigned to you. If you have the Software Installation rights profile, then use the pfexec command to install and update packages:

      $ pfexec pkg install jre-10
      

      Other rights profiles also provide installation privileges, such as the System Administrator rights profile.

    • While installing the updates, you need to accept the user license using the following command:
      $ pfexec pkg install jre-10 --accept
      
    • Depending on the security policy at your site, use the sudo command with your user password to execute a privileged command:

      $ sudo pkg install jre-10
      
    • Use the roles command to list the roles that are assigned to you. If you have the root role, then use the su command with the root password to assume the root role:

      $ pkg install jre-10
      

    Note:

    The JDK 10 installation from SVR4 package (through the pkgadd command) is not supported. Install JDK 10 using the IPS package.

Specifying the Default Java Platform

If there are multiple versions of Java installed on the same image, then you can specify the default or preferred Java version using Mediator. A mediator contains a set of links to different implementations of an application, where every link has the same mediator name and link path, but different target link paths.

View the Current Default Version

Use pkg mediator command to display all mediators in the image and the current default Java version.
$ /usr/bin/pkg mediator | grep java

Set the Default Java Version

Use the pkg set-mediator command to set Java 10 as the default or preferred version.
$ usr/bin/pkg set-mediator -V 10 java