Installing Business Studio or applying a hotfix fails when Tibco Universal Installer (TUI) uses Java 8 JRE.

Installing Business Studio or applying a hotfix fails when Tibco Universal Installer (TUI) uses Java 8 JRE.

book

Article ID: KB0087725

calendar_today

Updated On:

Products Versions
TIBCO Business Studio - BPM Edition -
Not Applicable -

Description

Description:
Applying a Studio/AMX hotfix to Business Studio can fail if TUI executes within a Java 8 JRE. This is less likely on Windows where the TUI uses the embedded JRE by default. Although TUI itself is Java 8 compatible, a necessary Studio ANT script relies on Java 7's "Rhino" JS Engine builtins. The same functions are not exposed in Java 8 "Nashorn" JS Engine, leading to errors during the execution of installation tasks.

Symptoms:
TUI application of hotfix to Business Studio fails showing a stacktrace similar to the following:

/path/to/Studio-TIBCO_HOME/tools/p2scripts/build.xml:156: javax.script.ScriptException: ReferenceError: "importClass" is not defined in <eval> at line number 5
        at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:467)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:451)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:403)
        at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:399)
        at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
        at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[stacktrace shortened] 
Caused by: <eval>:5 ReferenceError: "importClass" is not defined
        at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
        at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319)


Cause:
An ANT script used in the installation process for Studio Hotfix cannot execute in a Java 8 JRE. Java 8's "Nashorn" Javascript Engine does not provide some builtin functions which were present in Java 7's "Rhino" JS Engine, upon which this script relies. On Linux, TUI looks for an existing JRE in the system in preference to using its embedded JRE. It searches environment variables PATH, JDK_HOME, JAVA_HOME, then under common/expected paths. On Linux these include certain folders under /opt and /usr. If this search finds a 1.8 JRE, TUI will execute within it. This will trigger the issue. Note that all currently supported versions of Business Studio are based upon the affected Eclipse version. NonWindows versions of TUI exhibit the same JVM detection behavior.

Issue/Introduction

Installing Business Studio or applying a hotfix fails when Tibco Universal Installer (TUI) uses Java 8 JRE.

Resolution

Until this ANT script can be updated to detect the running JRE version and adjust itself appropriately, you must force TUI to use a Java 7 JRE. There are two simple and reliable ways to do this without affecting other potential users of the system JRE:

  TIBCOUniversalInstallerXYZ -is:skipJVMSearch 

  TIBCOUniversalInstallerXYZ -is:javahome /path/to/desired/JRE 


XYZ will depend on the OS and whether using the 32-bit/64-bit TUI version.


Notes: 
- All TUI versions support the -is:javahome option, allowing specification of the JRE with which to execute TUI itself.
- All Linux TUI versions >= 3.2.5v7 support the -is:skipJVMSearch option, forcing the use of the embedded JRE.

Additional Information

https://bugs.openjdk.java.net/browse/JDK-8025132
http://stackoverflow.com/questions/22503100/java-8-javascript-engine-backwards-compatibility