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 with the process ID of the running Java process to start debugging.
$ java -agentlib:dbx_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:
32-bit version of the JVM software on a system running the Oracle Solaris OS: add /install-dir/SUNWspro/lib/libdbx_agent.so
64-bit version of the JVM software on a SPARC based system running the Oracle Solaris OS: add /install-dir/SUNWspro/lib/v9/libdbx_agent.so to LD_LIBRARY_PATH
64-bit version of the JVM software on an x64 based system running the Linux OS: add/install-dir/sunstudio12/lib/amd64/libdbx_agent.so to LD_LIBRARY_PATH
install-dir is the location where the Oracle Developer Studio 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 -agentlib:dbx_agent $ dbx - 2345
The following task explains how to attach dbx to a specific Java process using a process ID.
java –agentlib:dbx_agent myclass.class
dbx -process-ID