Support for multiple Java Development Kits (JDKs)

The IBM® i platform supports multiple versions of the Java™ Development Kits (JDKs) and the Java 2 Platform, Standard Edition.

Note: In this documentation, depending on the context, the term JDK refers to any supported version of the JDK or the Java 2 Platform, Standard Edition (J2SE). Usually, the context in which JDK occurs includes a reference to the specific version and release number.

IBM i supports using multiple JDKs simultaneously, but only through multiple Java virtual machines. A single Java virtual machine runs one specified JDK. You can run one Java virtual machine per job.

Find the JDK that you are using or want to use, and select the coordinating option to install. See Installing Java on your IBM i server to install more than one JDK at one time.

When using IBM Technology for Java, you select which 5761-JV1 option to run (and therefore which JDK/bit mode) by setting the JAVA_HOME environment variable. Once a Java virtual machine is up and running, changing the JAVA_HOME environment variable has no effect.

The following table lists the supported options for this release.

5761-JV1 options JAVA_HOME java.version
Option 8 - IBM Technology for Java 5.0 32-bit /QOpenSys/QIBM/ProdData/JavaVM/jdk50/32bit 1.5
Option 9 - IBM Technology for Java 5.0 64-bit /QOpenSys/QIBM/ProdData/JavaVM/jdk50/64bit 1.5
Option 11 - IBM Technology for Java 6 32-bit /QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit 1.6
Option 12 - IBM Technology for Java 6 64-bit /QOpenSys/QIBM/ProdData/JavaVM/jdk60/64bit 1.6
Start of changeOption 13 - IBM Technology for Java 1.4.2 64-bitEnd of change Start of change/QOpenSys/QIBM/ProdData/JavaVM/jdk14/64bitEnd of change Start of change1.4End of change
Start of changeOption 14 - IBM Technology for Java 7 32-bitEnd of change Start of change/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bitEnd of change Start of change1.7End of change
Start of changeOption 15 - IBM Technology for Java 7 64-bitEnd of change Start of change/QOpenSys/QIBM/ProdData/JavaVM/jdk70/64bitEnd of change Start of change1.7End of change

The default JDK chosen in this multiple JDK environment depends on which 5761-JV1 Options are installed. The following table gives some examples. You can access IBM Technology for Java JDKs by setting the JAVA_HOME environment variable, or by specifying a fully qualified path to the Java tool or utility located in the JDK you want to use.

Install Enter Result
Start of changeAll supported options are installedEnd of change Start of changejava QIBMHelloEnd of change Start of change6 32-bit is used End of change
Start of changeOption 13 (1.4)End of change Start of changeJava QIBMHelloEnd of change Start of change1.4 is used End of change
Start of changeOption 13 (1.4) and Option 9 (5.0 64-bit)End of change Start of changejava QIBMHelloEnd of change Start of change5.0 64-bit is used End of change
Note: If you install only one JDK, the default JDK is the one you installed. If you install more than one JDK, the following order of precedence determines the default JDK:Start of change
  1. Option 11 - IBM Technology for Java 6 32-bit
  2. Option 12 - IBM Technology for Java 6 64-bit
  3. Option 8 - IBM Technology for Java 5.0 32-bit
  4. Option 9 - IBM Technology for Java 5.0 64-bit
  5. Option 14 - IBM Technology for Java 7.0 32-bit
  6. Option 15 - IBM Technology for Java 7.0 64-bit
  7. Option 13 - IBM Technology for Java 1.4.2 64-bit
End of change