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.