Option Name and Value Description Default --------------------- ----------- ------- suspend=y|n wait on startup? y 启动的时候是否等待建立远程的调试的socket连接 transport=<name> transport spec none 传输协议 address=<listen/attach address> transport spec "" 监听地址 server=y|n listen for debugger? n 是否监听调试 launch=<command line> run debugger on event none 时间发生的时候进入调试 onthrow=<exception name> debug on throw none onuncaught=y|n debug on any uncaught? n timeout=<timeout value> for listen/attach in milliseconds n mutf8=y|n output modified utf-8 n quiet=y|n
examples
Using socket connect to a debugger at a specific address[客户端]: java -agentlib:jdwp=transport=dt_socket,address=localhost:8080
Using sockets listen for a debugger t attach[服务器]: java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y
接下来我们使用监听的方式启动我们的应用: 运行命令:java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5050 -jar spring_lecture-1.0-SNAPSHOT.jar 服务端打印:Listening for transport dt_socket at address: 5050 idea的设置: