zoukankan      html  css  js  c++  java
  • Java remote debug(on startup)

    If you use intellij, you can use the function "Attach to local process..." if it doesn't work then you need to set up a remote debug to connect to your remote program(can be on the same machine or actual remote machine).

    Debugger side:

    a. Create a new remote debug configure

    b. Select "Socket", put localhost for local mahine or the actual host name if it's actual a remote host, host can be whatever as long as it's not occupied on remote host yet

    c. Start the java program with options of below, normally use the first option, if you need to debug right on startup then you need to second option.

    ####remote debug####

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

    ####remote debug on startup#####

      (Suspend=y which means program will suspend until connected to debugger, so debugger can execute right from the every beginnig of the program)

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

    e.g. java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8889 -cp . com.lefeng.MainClassName

  • 相关阅读:
    常用模块
    递归函数
    内置函数与匿名函数
    Mac控制台相关操作
    Maven相关知识记录
    @Import底层实现原理
    spring循环依赖
    springcloud注册中心对比
    分布式事务
    Drools使用注意事项
  • 原文地址:https://www.cnblogs.com/glf2046/p/6207990.html
Copyright © 2011-2022 走看看