To attach to a Java application started by Eclipse the following two approaches are possible.
The approach described here requires the permission to adjust the JRE installation, thus it might not be suitable in a lot of case. An alternative approach is described in our blog .
The following shell script should be created. (These steps are tailored towards Linux but should be easy to adapt for other systems.)
Create a shell script with the following content. The path to the Squish installation should be changed as well as the path to the JRE that is used by Eclipse.
The shell script needs to be placed into the Java installation. It has to
reside in the same directory as the
java binary, usually inside the
directory of the Java installation.
Run Configurations... >
Alternate JRE, but leave the JRE
selection as it is.
Java executable choose
Alternate and enter the name of the shell
script that was placed into the Java installation. Save the configuration and
use it to start the AUT.
In the Squish IDE register an
Attachable AUT at
Server Settings >
Manage AUTs..., for example with
Host "127.0.0.1" and
Port "4444" (all without double quotes).
attachToApplication() into an existing test script instead of
Launch AUT to connect to the AUT that is launched by Eclipse.