• 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

  • 相关阅读:
    Ecplilse使用
    JDK安装
    浏览器的前世今生
    RethinkDB
    [css]兼容性
    【js】undefined
    String面试题
    SOS.dll(SOS 调试扩展)
    【ajax跨域】原因原理解决
    腾讯WEB前端开发三轮面试经历及面试题
  • 原文地址:https://www.cnblogs.com/glf2046/p/6207990.html
Copyright © 2020-2023  润新知