Java Precedence in IBM i

Steven McIver, iTech Solutions

When considering which release of IBM i to upgrade to next, one of the important factors to consider is whether or not the available versions of Java at the target IBM i release are supported by the software that you are running on your system. If you were to upgrade to a new release where your installed software could not operate with the Java that is available, you could find yourself having to rollback to the previous IBM i release – completely erasing all the hard-spent time planning and executing the upgrade!

Most software vendors can quickly tell you whether or not their software will operate on the release of IBM i you are planning to go to. In the cases where the vendor cannot tell you, or the Java applications that you have are homegrown, there is a way to force your current release of IBM i to change what is known as its “Java Precedence”. This is done by adding an environment variable to your system environment that controls which version of Java it prefers to use. Your system will then use this version of Java unless your programs are coded to use a specific version of Java.

 

Here is the Java Precedence for releases in the past decade:

 

IBM i 7.4

  1. Option 16 – IBM Technology for Java 8.0 32-bit
  2. Option 17 – IBM Technology for Java 8.0 64-bit

IBM i 7.3

  1. Option 14 – IBM Technology for Java 7.1 32-bit
  2. Option 14 – IBM Technology for Java 7.0 32-bit
  3. Option 15 – IBM Technology for Java 7.1 64-bit
  4. Option 15 – IBM Technology for Java 7.0 32-bit
  5. Option 16 – IBM Technology for Java 8.0 32-bit
  6. Option 17 – IBM Technology for Java 8.0 64-bit

IBM i 7.2

  1. Option 11 – IBM Technology for Java 6 32-bit
  2. Option 12 – IBM Technology for Java 6 64-bit
  3. Option 14 – IBM Technology for Java 7.1 32-bit
  4. Option 14 – IBM Technology for Java 7.0 32-bit
  5. Option 15 – IBM Technology for Java 7.1 64-bit
  6. Option 15 – IBM Technology for Java 7.0 64-bit
  7. Option 16 – IBM Technology for Java 8.0 32-bit
  8. Option 17 – IBM Technology for Java 8.0 64-bit

IBM i 7.1

  1. Option 8 – IBM Technology for Java 5.0 32-bit
  2. Option 9 – IBM Technology for Java 5.0 64-bit
  3. Option 11 – IBM Technology for Java 6 32-bit
  4. Option 12 – IBM Technology for Java 6 64-bit
  5. Option 13 – IBM Technology for Java 1.4.2 64-bit

As you can see, at IBM i 7.4, your options are limited to just the 64 and 32-bit versions of Java 8. If you want to force your environment to use the 64-bit version of Java 8, you can do so by running the following CL command:

 

ADDENVVAR ENVVAR(JAVA_HOME) VALUE(‘/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit’) LEVEL(*SYS)

 

This will add a system-wide environment variable that will set the JAVA_HOME to the version Java 8 64-bit. Currently, running applications will need to be ended and restarted. You can verify your applications are using the targeted version by using the command WRKJVMJOB. The screenshot below is an example that confirms the selected Java virtual machine is running on Java 8 64-bit.

 

 

We don’t recommend just slapping this environment variable on your production system during a busy workday. Ideally, perform these tests on a test partition first, and then work it into production once all application validations have been performed. The ultimate goal is to have all of your applications using the target version of Java before making the upgrade, which will ensure a smooth transition.

 

More from this month:

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *