Page tree

Uniface and Java Runtime Environments


Background

Oracle has changed their support statement for Oracle JRE 1.8 and higher. Updates to Oracle JRE 1.8 released after the 15th January 2019 are free only if the JRE is used for development, testing, or demonstration purposes. For commercial uses, you must purchase a subscription from Oracle to receive the updates.

As customers typically use Uniface and the JRE it requires for commercial purposes, these installations are subject to the new support statement, and installations of the Oracle JRE 1.8 will require a subscription from Oracle. Therefore, if you have the JRE that came with Uniface 9 or 10 installed on any Windows machine, or if you installed Oracle JRE 1.8 separately on any operating system, for commercial purposes, you must take action. Uniface 10.3.02 and above will be shipped with OpenJDK rather than the Oracle JRE.

In this technical article, we describe what you, as a Uniface customer using Uniface and the JRE 1.8 for commercial purposes, can do to deal with this situation.

Options

Your options are:

  • Do nothing, especially do not update your Oracle JRE 1.8 installation(s) to a version that was released after January the 15th. However, if you choose this option, you will no longer receive security updates to the JRE.
  • Acquire subscriptions from Oracle to receive updates to Oracle JRE 1.8. If you choose this option, you can apply updates to the JRE as before. You do not need to change your Uniface or Oracle JRE installation(s).
  • Replace your Oracle JRE 1.8 with a different JRE that continues to supply the updates free. For example, the AdoptOpenJDK provides OpenJDK 8 for free, including updates.

The rest of this article describes the third option—replacing your Oracle JRE 1.8 installation with OpenJDK 8 from AdoptOpenJDK.

Note: You can also choose a JRE from another vendor, but the one from AdoptOpenJDK is the one we have tested and found satisfactory.

Replacing Oracle JRE 1.8 with AdoptOpenJDK

When you installed Uniface on Windows, the installer asked whether it should install a new copy of the JRE 1.8 or configure Uniface to use an existing Java installation.

  • In the first case, the Oracle JRE 1.8 was installed in subdirectory common\jre of the Uniface installation folder. This JRE needs replacing.
  • In the second case, an existing JRE was selected for Uniface to use. If this existing installation is Oracle JRE 1.8, it also needs to be replaced.

You can replace Oracle JRE 1.8 with the AdoptOpenJDK OpenJDK 8 by following these steps.


Assumptions:

  • Your JRE installation has not been significantly altered.
  • You are installing the Hotspot variety of the AdoptOpenJDK OpenJDK 8


  1. Download OpenJDK 8 from AdaptOpenJDK
    URL: [https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=hotspot]
  2. Extract the package onto your local hard drive. If you are replacing a JRE that is in the common\jre of the Uniface installation, extract it into the common directory, next to jre. Otherwise, choose a different location. The extraction results in a new directory called something like jdk8u202-b08-jre (the numbers could be different).
  3. Stop the Uniface Tomcat web server and any (Uniface) process that might be using the JRE that you are about to replace.
  4. If you are replacing common\jre, the most straightforward course of action is to rename directory jre to jreOLD, and rename directory jdk8u202-b08-jre to jre. Skip steps 5 to 7 and continue with step 8.
  5. Find jvm.dll in the extracted OpenJDK directory structure. It should be in bin\server. Make a note of this path, fully qualified. You need it in steps 6 and 7.
  6. In the usys.asn (or any other assignment file in which it is set), replace the path to the jvm.dll. For example, replace 
    C:\Program Files\Uniface\common\jre\bin\server\jvm.dll(JNI_CreateJavaVM)
    with the path you made a note of in step 5:
     C:\Program Files\Uniface\common\ jdk8u202-b08-jre\bin\server\jvm.dll(JNI_CreateJavaVM) 
    Do not remove the \jvm.dll(JNI_CreateJavaVM) part.
  7. In the file service.bat in common\tomcat\bin replace the path to JRE at line 5, for example, replace:
    set JRE_HOME=C:\Program Files\Uniface\common\jre
    with 
    set JRE_HOME=C:\Program Files\Uniface\common\jdk8u202-b08-jre
    Do not specify the subdirectory and DLL.
  8. Remove old Tomcat logs in common\tomcat\logs.
  9. Start the Uniface Tomcat web server.
  10. After 20 seconds, look at the logs in common\tomcat\logs.
    There should be a log file that has stderr in its name. Open it with a text editor. It should contain only INFO lines, no exceptions or ERROR lines. Three of those INFO lines are of note:

    Java Home specifies the path to the JRE that Tomcat is using. This location should be the path where you extracted the OpenJDK 8 package;
    JVM Version specifies the JVM version. The version should be equal to the one downloaded from the AdoptOpenJDK site;
    JVM Vendor specifies Oracle Corporation

  11. If you are using XSLT transformations in your application (USYSXSLT), test this part of your application now.
  12. If you are using Uniface's Java-callin functionality and have replaced the JRE in common\jre, test this part of your application now.
    If you are using Uniface's Java-callin functionality but have extracted OpenJDK 8 to some other location, you need to update your scripts, Java programs and Java environment settings so that your Java programs use the new OpenJDK 8.
  13. If you are satisfied that Uniface, Tomcat, and your Java programs are now using OpenJDK 8 and that all works as expected, you can go ahead and remove the old Oracle JRE 1.8 installation.
  14. If you renamed the jre directory under common to jreOLD in step 4, remove this directory and its contents.
    Note: We recommend old JRE installations are removed so that there is no confusion later as to which JRE is being used.
  15. Repeat all of this for any other Uniface installation you may have on any machine.