JDB - Options
This chapter describes the important options available in JDB that are submitted as arguments with the jdb command.
The following table contains a list of options accepted by JDB:
|-help||Displays the help message and lists the related options.|
|-sourcepath||Uses the given path for source files if path is not specified, then it takes the default path “.”, i.e., the current directory.|
|-attach||Attaches the debugger to the running VM by specifying the running VM address.|
|-listen||Waits for the running VM to connect using standard connector.|
|-listenany||Waits for the running VM to connect using any address.|
|-launch||Launches the debugged application immediately up on startup job.|
|-listconnectors||Lists the connectors available in this VM.|
|-connect||Connects to the target VM using named connector with listed argument values.|
|-dbgtrace||Prints information for debugging jdb.|
|-tclient||Runs the application in Java Hotspot VM (client).|
|-tserver||Runs the application in Java Hotspot VM (server).|
|-Joption||Passes the option to the Java virtual machine used to run JDB.|
Using Options with Commands
The following commands show how to use some of the above options:
The following command gets -help on using JDB.
The following command attaches the debugger to a specified VM (port number:1099).
\> jdb -attach 1099
The following command makes the JDB process running on the current VM wait using standard connector (VM in 8008).
\>jdb -listen 8088
The following command makes the JDB process running on the current VM wait using any connector (VM in currently running port).
The following command executes the application in Java Hotspot(™) VM(client).
The following command executes the application in Java Hotspot(™) VM(server).