Testing Against Mutiple JDKs

Last edited on

Basics

A configured Squish installation can only work with one selected JRE.

In order to test applications with different Java versions, you must install multiple versions of Squish, each in its own directory. Then,before running any of these Squishs’ setup or squish executables, make sure that the environment variable SQUISH_USER_SETTINGS_DIR is set differently for each Squish installation.

The process can be simplified by using a batch file or shell script. For example:

set SQUISH_USER_SETTINGS_DIR=C:\squish\jre-1.5
C:\squish\jre-1.5\bin\squish

Advanced

The following points needs to be addressed for this approach to work:

  1. For Squish 3, Squish generates a small JRE-specific rt.jar file during setup (SQUISHDIR/lib/squishrt.jar).

  2. Squish sets the location of the JRE-specific libjvm.so file in the AUT environment.

Two exports are needed to override the ones from the setup: SQUISH_JAVA_DEF_1 (to address point 1) and SQUISH_LIBJVM (to address point 2).

When using the command line hooking, i.e. skipping the alternative jvm lib, the other SQUISH_JAVA_DEF_X needs to be added to the java executable. Note that for jre-1.4, the SquishClassLoader setting is an extra SQUISH_JAVA_DEF_N when using SWT.