Attach to Virtual Machine




See also


You can debug a Java application by attaching to process that is hosting a Java Virtual Machine; you might want to do this for attaching to a webserver such as Tomcat or JBOSS.

The Java Virtual Machine Tools Interface from Sun Microsystems, is the API used by Enterprise Architect; it allows a debugging agent to be specified when the JVM is created.

To debug a running JVM from Enterprise Architect, the Sparx Systems' debugging agent must have been specified as a startup option to the JVM when it was started; how this accomplished for products such as Tomcat and JBOSS should be researched from that product's own documentation.

For java.exe, the command line option to load the Enterprise Architect debugging agent depending on your environment could be:


·-agentpath:"c:\program files\sparx systems\ea\VEA\x86\SSJavaProfiler32"
·-agentpath:"c:\program files (x86)\sparx systems\ea\VEA\x86\SSJavaProfiler32"
·-agentpath:"c:\program files (x86)\sparx systems\ea\VEA\x64\SSJavaProfiler64"


The the appropriate option will depend on your operating system and whether you are working on a 32-bit application or a 64-bit application.

Alternatively, if you add the appropriate VEA directory to your PATH environment variable you can choose to use:




It is not necessary to configure an Analyzer Script when you attach to a Virtual Machine; you can just use the Attach button on one of the Analyzer toolbars.

If you configure an Analyzer Script, there are only two things that must be selected:

·Select Java as the debugging platform
·Choose the Attach to Virtual Machine option












Debug Another Process