Transformation Map prepare error after installing Java 8

Date:18 May 2015
Product/Release:LANSA Composer - V5.0
Abstract:Transformation maps that could successfully be prepared with Java 7 fail when Java 8 is used.
Submitted By:LANSA Technical Support


A LANSA Composer client installation using an earlier version of Java (for example, the JDK 1.7 that is shipped with LANSA Composer version 5.0) is able to successfully prepare Transformation Maps.
After installing Java 8, Transformation Maps fail to prepare. While LANSA Composer is at the Compile code for transformation map stage, the following error is seen:
Example of Java Virtual Machine Launcher error message
After clicking OK, further error dialogs are shown with messages similar to the following:
Error: could not find java.dll
Error: could not find Java SE Runtime Environment


LANSA Composer’s map prepare starts Java to compile the Java code using an unqualified reference to javaw.exe. That is, it relies on the usual Windows search algorithm to locate the executable file. The result is that it first searches pre-defined Windows locations (such as C:\Windows\SysWOW64) and then locations specified by the PATH environment variable.
When the earlier Java version was installed it installed copies of one or more of the Java executables java.exe, javaw.exe and/or javaws.exe in one of the following locations (depending on whether the OS is 32-bit or 64-bit):
When Java 8 is installed, it installs shortcuts to its own java.exe, javaw.exe and/or javaws.exe in a new location, which it also adds to the start of the PATH environment variable.
It does not update, replace or remove the existing executables files in C:\Windows\System32 and/or C:\Windows\SysWOW64.
(Note that it might only be necessary that the Java 8 JRE (not necessarily the JDK) was installed to lead to this issue. For example, installing a Java application that install Java 8 JRE might also lead to the same result.)
When LANSA Composer attempts to start Java using javaw.exe, the Java 7 executable in C:\Windows\SysWOW64 is started. As javaw.exe proceeds to load further executable files it requires (eg: java.dll), something in the new configuration causes it to locate and load the Java 8 executables, which are incompatible with the earlier version, leading to the reported errors.

Suggested Resolution

  1. Remove the “old” Java executables from C:\Windows\System32 and/or C:\Windows\SysWOW64. In our testing, this step resolved the issue and allowed the Transformation Map prepare to proceed to normal completion.
  2. Alternatively, try changing the PATH environment variable value to put the Java 7 location ahead of the new Java 8 location.
  3. Temporarily change the registry entry (Software\JavaSoft\Java Runtime Environment\CurrentVersion) from 1.8 to 1.7 before compiling maps. After the compiles, replace the registry value, if required.

Of the 3 suggested solutions, in our testing, suggestion 1 was the only one that gave consistent results (allowing the transformation map prepare to succeed). Other OS factors, beyond the scope of our testing, may be at play in suggestions 2 and 3.