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

 

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

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.

Classic JDK = Original JDK version. This JDK is considered deprecated and supported on a limited basis. IBM does not recommend this JDK version be used. The IBM Technology for Java VM is the preferred JDK. For more information on the support of this JDK, please refer to the following URL:


IBM i Classic Java Virtual Machine (JVM) - Official Product Support Information

IBM Technology for Java = IT4J = IBM Recommended JDK due to its superior performance and reduced resource utilization compared to the Classic JDK.

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

IBM i 5.4 LPPs
Product Option
JDK Version
JDK Bit Level
5722JV1
Option 5
Classic 1.3
64 bit
5722JV1
Option 6
Classic 1.4.2
64 bit
5722JV1
Option 7
Classic 5.0 (1.5)
64 bit
5722JV1
Option 8
IT4J 5.0 (1.5)
32 bit
5722JV1
Option 10
Classic 6.0 (6.0)
64 bit
5722JV1
Option 11
IT4J 6.0 (1.6)
32 bit
IBM i 6.1 only LPPs
     
5761JV1
Option 6
Classic 1.4.2
64 bit
5761JV1
Option 7
Classic 5.0 (1.5)
64 bit
5761JV1
Option 10
Classic 6.0 (1.6)
64 bit
IBM i 6.1 and 7.1 LPPs
     
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
IBM i 7.1 only LPPs
     
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 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

 

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)

 

 

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 6.2.6 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/jdk626/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 6.2.6 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/jdk626/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 6.0 64 bit JDK - The Qshell command would be:
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk60/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/jdk60/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/jdk60/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/jdk60/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/jdk60/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.

Cross reference information
Product Component Platform Version Edition
IBM i 7.2
IBM i 7.1
IBM i 6.1
IBM i 7.3

Document information

More support for: IBM i

Component: Java

Software version: 5.4.0, 5.4.5, 6.1.0, 6.1.1, 7.1, 7.2, 7.3

Operating system(s): IBM i

Reference #: N1019917

Modified date: 16 August 2018


Translate this page: