OPTIONAL EXTRA - Download and Install Java 17

Download and Install Developer Kit for Java 17 64bit

The instructions for download are nicely detailed here

In essence, download the version of Developer Kit for Java 17 applicable for your system.

For IBM i V7R4 it is called:

OPTIONAL EXTRA - Download and Install Java 17 1

For IBM i V7R5 it is (rather confusingly) called:

OPTIONAL EXTRA - Download and Install Java 17 2

Once you have downloaded the hefty install fil (around 1.5GB) let's upload and install it on our IBM i System.

Upload and Install Java 17

Create a new directory named /home/jdk17 on your IBM i server (use the command MKDIR '/home/jdk17')

MKDIR '/home/jdk17'

After creating the directory, transfer the downloaded .zip file to the newly created IFS directory, /home/jdk17.

Upload the ISO to this folder /home/jdk17

OPTIONAL EXTRA - Download and Install Java 17 3

Install Java 17

Once the upload is complete - unzip it and get it ready for install:

My system is IBM i 7.5, if you are on a different release the file name in the commands may vary slightly. Use these instructions for installing JDK 17 using the UDF image catalog from an IBM i CL command line.

CHGOPTA EXTMEDFMT(*YES)

NOTE: The CHGOPTA command must be issued before the LODIMGCLG command shown below. If it is issued after the LODIMGCLG command, you will need to re-load the catalog.

OPTIONAL EXTRA - Download and Install Java 17 4
CRTIMGCLG IMGCLG(jdk17) DIR('/home/jdk17/IMAGE') CRTDIR(*YES)
OPTIONAL EXTRA - Download and Install Java 17 5
ADDIMGCLGE IMGCLG(jdk17) FROMFILE('/home/jdk17/B_GROUP1_05_IBM_i_RS_750-00_LCD8_2685_00.udf') TOFILE(*fromfile)
OPTIONAL EXTRA - Download and Install Java 17 6

NOTE: If the OPTVRT01 device description already exists, please continue to the next step.

CRTDEVOPT DEVD(OPTVRT01) RSRCNAME(*VRT)
OPTIONAL EXTRA - Download and Install Java 17 7
VRYCFG CFGOBJ(OPTVRT01) CFGTYPE(*DEV) STATUS(*ON)
OPTIONAL EXTRA - Download and Install Java 17 8
LODIMGCLG IMGCLG(jdk17) DEV(OPTVRT01)
OPTIONAL EXTRA - Download and Install Java 17 9

Ensure the Developer_Kit_for_Java_17_64bit image is mounted in WRKIMGCLGE IMGCLG(jdk17). You can enter option 6 next to the image to mount it.

WRKIMGCLGE IMGCLG(jdk17)
OPTIONAL EXTRA - Download and Install Java 17 10

Now just MOUNT that volume with a 6

OPTIONAL EXTRA - Download and Install Java 17 11

Install the Licensed Program

RSTLICPGM LICPGM(5770JV1) OPTION(20) RSTOBJ(*PGM) DEV(OPTVRT01)
OPTIONAL EXTRA - Download and Install Java 17 12

Finally, download and install the latest IBM i Java Group PTF to complete the LPP installation.

IBM i 7.5 - SF99955 level 5 or later
IBM i 7.4 - SF99665 level 18 or later

Check the Licensed Program Installed

GO LICPGM 
Option 10
OPTIONAL EXTRA - Download and Install Java 17 13
OPTIONAL EXTRA - Download and Install Java 17 14

Looks good!

In order to use Java 17 64 bit on the IBM i OS, the JAVA_HOME environment variable will need to be set to /QOpenSys/QIBM/ProdData/JavaVM/jdk17/64bit.

How to Use the new Java

To change the default JDK system-wide to JDK 17 64 bit:

ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk17/64bit') LEVEL(*SYS)

To change the current job to JDK 17 64 bit:

ADDENVVAR ENVVAR(JAVA_HOME) VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk17/64bit') LEVEL(*JOB)

To change the current Qshell session to use JDK 17 64 bit

export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk17/64bit

You can check this value with:

WRKENVVAR 
OPTIONAL EXTRA - Download and Install Java 17 15
OPTIONAL EXTRA - Download and Install Java 17 16

Note the LEVEL parameter - Specifies the level of the environment variable. The possible values are: 

  • *JOB This is a job-level environment variable.
  • *SYS This is a system-level environment variable.

And that's that!

You have installed Java 17 and set the system to use it by default!

Final Step - Cleanup

Now an important step which is frequently overlooked - lets cleanup the uploaded installer file and folder. We don't need this anymore (because the install was successful) so lets just delete it.

RMVDIR DIR('/home/jdk17') SUBTREE(*ALL)

Resources

Resource 1

IBM installation manager for IBM i (MIRROR COPY)

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>