3 Installation of the JDK on Oracle Solaris

This topic includes the following sections:

System Requirements for Installing the JDK on Oracle Solaris

JDK 11 is supported on Oracle Solaris SPARC (64-bit), version 11.4 or later.

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

Note:

JDK 17 for Solaris does not support the following:
  • Z Garbage Collector (ZGC)
  • Application Class-Data Sharing (AppCDS)
  • JVM Compiler Interface (JVMCI)
  • Headful graphics

In addition, JDK 17 for Solaris does not include the following:

  • jpackage, jlink, jimage, or jmod tools
  • JMOD files for use with the jlink tool

The Java 2D API is supported for printing purposes.

JDK Installation Instruction Notation for Oracle Solaris

For JDK installation instructions that contain the notation interim.update.patch (see Version-String Format), substitute the appropriate update version number.

Note:

Trailing zeroes are truncated from interim.update.patch.

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

jdk-11.interim.update.patch_solaris-sparcv9_bin.tar.gz

This string becomes:

jdk-11.0.19_solaris-sparcv9_bin.tar.gz

Installation of JDK on Oracle Solaris from Archive Binaries

You can install JDK 11 on Oracle Solaris from archive binaries (.tar.gz).

To install the JDK from an archive binary on Oracle Solaris:
  1. Download the archive binary for Oracle Solaris from Java Downloads. Its file name is jdk-11.interim.update.patch_solaris-sparcv9_bin.tar.gz.

    Ensure that you accept the license agreement before downloading the file.

    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 operating system.

    You can simultaneously uncompress and extract the .tar.gz archive binary (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 binary to the current directory.
  4. Install the JDK by unpacking the archive binary:
    $ gzip -dc jdk-11.interim.update.patch_solaris-sparcv9_bin.tar.gz | tar xf -

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

Installing JDK on Oracle Solaris 11 from IPS Packages

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

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

    $ pkg list -a jdk-11.interim.update.patch

    Name (Publisher) Version IFO
    developer/java/jdk-11.interim.update.patch 11.0.1.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-11.interim.update.patch

      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-11.interim.update.patch
    • 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-11.interim.update.patch

      Note:

      The JDK 11 installation from the SVR4 package (through the pkgadd command) is not supported. Install JDK 11 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 11 as the default or preferred version.
$ usr/bin/pkg set-mediator -V 11.interim.update.patch java