idea java 远程调试

以前一直用eclipse,最近改用idea.记录下idea的远程调试。

一.启动服务

1.配置tomcat 启动参数增加  

-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

 参数解释:

    -Xdebug 启用调试 

  transport             用于在调试程序和 VM 使用的进程之间通讯。 

  dt_socket             套接字传输。 

  server=y/n            VM 是否需要作为调试服务器执行。 

  address=3999          调试服务器的端口号,客户端用来连接服务器的端口号。 

  suspend=y/n           是否在调试客户端建立连接之后启动 VM 。

2.启动(不是调试模式)

二.远程调试

1.配置参数

host:localhost   port 5005

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

2.debug启动(只有这个启动)

参考:https://cloud.tencent.com/developer/article/1016019

猜你喜欢

转载自www.cnblogs.com/treehesoft/p/10901244.html