Error Message "Cannot connect to VM"

Last edited on

When using Eclipse as the AUT and trying to start the Java debugger it is possible that an error occurs which results in a dialog like this popping up:

Problem Occurred

‘Launching myapp’ has encountered a problem.

Cannot connect to VM socket closed


The console view shows:

NPT ERROR: Cannot open library


To avoid this problem unset the environment variable JDK_ALTERNATE_VM before starting Eclipse. This could be done, for example, in a batch file:

eclipse -vm "%_JDK_ALTERNATE_VM%"