You can attach dbx to a running Java application if you specified the options shown in the following example when you started the application. After starting the application, you would use the dbx command (see dbx Command) with the process ID of the running Java process to start debugging.
$ java -Djava.compiler=NONE -Xdebug -Xnoagent -Xrundbx_agent myclass.class $ dbx - 2345
For the JVM software to locate libdbx_agent.so, you need to add the appropriate path to LD_LIBRARY_PATH before running the Java application:
If you are using the 32-bit version of the JVM software on a system running the Solaris OS, add /installation_directory/SUNWspro/lib/libdbx_agent.so
If you are using the 64-bit version of the JVM software on a SPARC based system running the Solaris OS, add /installation_directory/SUNWspro/lib/v9/libdbx_agent.so to LD_LIBRARY_PATH.
If you are using the 64-bit version of the JVM software on an x64 based system running the Linux OS, add/installation_directory/sunstudio12/lib/amd64/libdbx_agent.so to LD_LIBRARY_PATH.
The installation_directory is the location where the Sun Studio software is installed.
When you attach dbx to the running application, dbx starts debugging the application in Java mode.
If your Java application requires 64-bit object libraries, include the -d64 option when you start the application. Then when you attach dbx to the application, dbx will use the 64-bit JVM software on which the application is running.
$ java -Djava.compiler=NONE -Xdebug -Xnoagent -Xrundbx_agent -d64 myclass.class $ dbx - 2345