IBM Support

How to determine what Java Development Kits (JDKs) are installed and use them in your environment?

Question & Answer


Question

This document will discuss how to determine what JDK versions/bit levels are installed and how to use them in your environment.

Answer

As of December 31st, 2017, the following IBM JDK LPPs no longer have defect and development support. Best effort support is available if your IBM i OS VRM has a valid SWMA support contract.

5722JV1 All Options
5761JV1 Options 6,7,8,9,10,11,12,13
5770JV1 Options 11,12

After September 30th, 2022...
5770JV1 Options 14,15

How to determine what JDK versions and bit levels are installed?

To determine what JDK versions and bit levels are currently installed on your system, execute the "GO LICPGM" command on the CL command line. Then, enter option "10" and press ENTER. Finally, press the F11 key twice to view the "Product Option" column.

Scroll down the list of licensed program products until you locate the 57xxJV1 program products. If you are unable to locate the 57xxJV1 product ID in the list, then no JDKs are currently installed on your system.

If you need to install additional 57xxJV1 LPP options, please refer to the following URL to find which IBM i Standard Set media disc contains the JV1 option you wish to install.

Standard and Keyed Media Set - Master List

IBM recommends using JDK v8.0 as your default JDK version on your IBM i server. Information on how to download and install JDK v8.0 on the IBM i OS at IBM i 7.1 and later can be found in the following IBM Technical Document.
Support of Java Development Kit (JDK) 8.0 on the IBM i OS

Information on how to download and install Java 11 and 17 on the IBM i OS can be found here:

Download, Installation, and Usage of Java 11 on the IBM i OS
Download, Installation, and Usage of Java 17 on the IBM i OS

Once you have located your 57xxJV1 licensed program product options, you can use the following table to match up the option to the JDK version and bit level.

IBM Technology for Java = IT4J

NOTE: Only the IT4J JDKs exist at IBM i 7.1 and later.

IBM i 7.1 LPPs
Product Option
JDK Version
JDK Bit Level
5761JV1
Option 8
IT4J 5.0 (1.5)
32 bit
5761JV1
Option 9
IT4J 5.0 (1.5)
64 bit
5761JV1
Option 11
IT4J 6.0 (1.6) / 6.2.6
32 bit
5761JV1
Option 12
IT4J 6.0 (1.6) / 6.2.6
64 bit
5761JV1
Option 13
IT4J 1.4.2
64 bit
5761JV1
Option 14
IT4J 7.0 / 7.1
32 bit
5761JV1
Option 15
IT4J 7.0 / 7.1
64 bit
5761JV1
Option 16
IT4J 8.0
32 bit
5761JV1
Option 17
IT4J 8.0
64 bit
IBM i 7.2 only LPPs
5770JV1
Option 11
IT4J 6.0 (1.6) / 6.2.6
32 bit
5770JV1
Option 12
IT4J 6.0 (1.6) / 6.2.6
64 bit
IBM i 7.2 and 7.3 LPPs
5770JV1
Option 14
IT4J 7.0 / 7.1
32 bit
5770JV1
Option 15
IT4J 7.0 / 7.1
64 bit
5770JV1
Option 16
IT4J 8.0
32 bit
5770JV1
Option 17
IT4J 8.0
64 bit
IBM i 7.3 only LPPs
5770JV1 Option 19 IT4J 11 64 bit
IBM i 7.4 and 7.5 LPPs
5770JV1 Option 16 IT4J 8.0 32 bit
5770JV1 Option 17 IT4J 8.0 64 bit
5770JV1 Option 19 IT4J 11 64 bit
5770JV1 Option 20 IT4J 17 64 bit


IBM i OS default JDKs - this is the JDK used if the JAVA_HOME environment is not configured system-wide or at the job scope.

IBM i 5.4 - Classic 1.4.2 64 bit

IBM i 6.1 - IT4J 5.0 32 bit

IBM i 7.1 - IT4J 6.0 32 bit

IBM i 7.2 - IT4J 7.1 32 bit

IBM i 7.3 - IT4J 8.0 32 bit

IBM i 7.4 - IT4J 8.0 64 bit

IBM i 7.5 - IT4J 8.0 64 bit


How to set up your environment to use one of the IT4J JDKs?

NOTE: We will not discuss how to set up and use the Classic JDK on the IBM i since IBM recommends the IBM Technology for Java (IT4J) JDK be used instead.

The IT4J JDK version and bit level is controlled through the JAVA_HOME environment variable. This environment variable can be set system-wide, for a specific job, or for a specific user profile.

NOTE: When the JAVA_HOME variable is set system-wide, this will change the default operating system JDK version and bit level and may negatively affect the user Java applications running on your server. IBM recommends controlling the JDK version and bit level by setting the JAVA_HOME environment variable at the job scope to customize the version and bit level for your specific Java application.

Commands to change the IBM i OS default JDK:

The JVM job would have to be restarted to pick up the change.

IT4J JDK 1.4.2 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk14/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 5.0 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk50/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 5.0 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk50/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 6.0 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk60/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 6.0 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk60/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 6.2.6 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk626/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 6.2.6 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk626/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 7.0 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk70/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 7.0 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk70/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 7.1 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk71/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 7.1 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk71/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 8.0 32 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/32bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 8.0 64 bit (IBM Recommended)
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 11 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk11/64bit') LEVEL(*SYS) REPLACE(*YES)

IT4J JDK 17 64 bit
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk17/64bit') LEVEL(*SYS) REPLACE(*YES)


Commands to set the JDK version and bit level at the JOB scope:

When setting the JDK version and bit level at the JOB scope, there are a couple of options you can use to set the JAVA_HOME environment variable. The method that is appropriate for you will depend on how you are invoking your Java application.

RPG Java Native Interface (JNI) applications and the RUNJVA/JAVA CL command

IBM recommends you set the JAVA_HOME by executing the ADDENVVAR CL command with LEVEL(*JOB) at the beginning of your program. You would use the same ADDENVVAR command listed above for the JDK version and bit level you wish to use, but the LEVEL parameter would be set to *JOB.

For example: To set my JOB to use the IT4J 8.0 64 bit JDK, I would execute the following CL command at the beginning of my program.
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit') LEVEL(*JOB) REPLACE(*YES)

QSH CL Command

With this CL command, you can set the JAVA_HOME environment variable using the ADDENVVAR CL command BEFORE the QSH CL command is called or with the "export" Qshell command before the "java" command is executed.

ADDENVVAR CL command - You would use the same ADDENVVAR command listed above for the JDK version and bit level you wish to use, but the LEVEL parameter would be set to *JOB.

For example: To set my JOB to use the IT4J 8.0 64 bit JDK, I would execute the following CL command at the beginning of my program.
ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit') LEVEL(*JOB) REPLACE(*YES)

"export" Qshell command - This command can be invoked a number of ways but must be invoked in the same shell as the "java" command. You can use the values from the VALUE parameter on the ADDENVVAR CL commands listed above for the JDK version and bit level you wish to use.

i.e. IT4J 8.0 64 bit JDK - The Qshell command would be:
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit

Here are the different methods the "export" command can be invoked.
- In the QSH CL command in the same shell before the "java" command.

i.e. QSH CMD('export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit;java MyProgram')
 

- In a Qshell script that is then executed by the QSH CL command.

i.e. The shell script would contain the following lines:
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit
java MyProgram
Then, the QSH CL command would be:
QSH CMD('shellScript')
 

- For a specific Qshell/PASE user. NOTE: This will affect all JVMs created in Qshell and PASE for this user profile.

i.e. Create a file named ".profile" in the user profile's home directory and include the following line.
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit

If the home directory for my JVM user was /home/jvmuser, I would create a file called ".profile" in the directory /home/jvmuser. Then, I would edit the /home/jvmuser/.profile file and include the "export" command as you see in the example above.

After the ".profile" is set up, any JVM created in Qshell or PASE by the user profile will use the JVM version and bit level specified by the export JAVA_HOME command.

- For all Qshell shells (global setting). NOTE: This will affect all JVMs created in all Qshell shells.

i.e. Create a file named "profile" in the /etc directory and include the following line.
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit

After the "/etc/profile" is created with the "export JAVA_HOME" command, any user creating a JVM via Qshell will use the JVM version and bit level specified.

[{"Type":"SW","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CH5AAM","label":"Java Development Kit"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Version(s)"}]

Document Information

Modified date:
23 August 2023

UID

nas8N1019917