zoukankan      html  css  js  c++  java
  • Remote Debugging (1)

    The client/server design of the Java debugger allows you to launch a Java program from computer on your network and debug it from the workstation running the platform.  This is particularly useful when you are developing a program for a device that cannot host the development platform.  It is also useful when debugging programs on dedicated machines such as web servers.  
    
    Note:  To use remote debugging, you must be using a Java VM that supports this feature.
    
    To debug a program remotely, you must be able to launch the program in debug mode on the remote machine so that it will wait for a connection from your debugger.  The specific technique for launching the program and connecting the debugger are VM-specific.  The basic steps are as follows:
    1.Ensure that you are building your Java program with available debug information.  (You can control these attributes from the  Goto the Java compiler preference page Java > Compiler preference page).  
    2.After you build your Java program, install it to the target computer.  This involves copying the .CLASS files or .JAR files to the appropriate location on the remote computer.
    3.Invoke the Java program on the remote computer using the appropriate VM arguments to specify debug mode and a communication port for the debugger.
    4.Start the debugger using a remote launch configuration and specify the address and port of the remote computer.
    
    When setting up the remote launch configuration there are a few items to take note of:
    •You must ensure you enter the correct hostname i.e. the name of the remote computer where you are currently running your code. The hostname can also be the IP address of the remote machine, for example using 127.0.0.1 instead of localhost.
    •The port number must be the number of the port on the remote machine.
    
    Certain Java VMs support another way of starting a remote debug session. In this alternative connection type, the debugger is launched first. The debugger then waits and listens for the VM to connect to it. To debug this way, you must properly configure and launch a remote debug session, then launch the VM, specifying the location of your waiting debugger. For more information, see Using the remote Java application launch configuration.
    Eclipse Help

    可以远程调试 a Java program  这里包含web项目application项目EJB项目

    这个功能非常有用,当有一个你不能部署但是正在运行的复杂的项目

     前 提 

    To debug a program remotely, you must be able to launch the program in debug mode on the remote machine so that it will wait for a connection from your debugger. The specific technique for launching the program and connecting the debugger are VM-specific. The basic steps are as follows:

    1. Ensure that you are building your Java program with available debug information. (You can control these attributes from the Goto the Java compiler preference page Java > Compiler preference page).
    2. After you build your Java program, install it to the target computer. This involves copying the .CLASS files or .JAR files to the appropriate location on the remote computer.
    3. Invoke the Java program on the remote computer using the appropriate VM arguments to specify debug mode and a communication port for the debugger.
    4. Start the debugger using a remote launch configuration and specify the address and port of the remote computer.

    翻译:

    为了远程调试一个程序,你必须能够在远程机器上以debug模式启动这个程序,以便与调试器建立连接。点击这里查看文档

    1. 确保携带着可用的调试信息构建你的java程序
    2. 构建完毕之后,将它安装到目标机器。将.CLASS 或.JAR 拷贝的远程机器的适当位置
    3. 调用这个指定了debug模式和通信端口的远程机器上的Java程序
    4. 启动这个使用了远程调试模式且指定了远程机器的地址和端口的调试器

    注:

    ①调试信息包括:

    ②debug模式启动服务:

    -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y

    这里有一个例子

    Remote Debugging an EJB on WebLogic Server 10.0.1 with JDeveloper 10.1.3.3

  • 相关阅读:
    Ilya Muromets(DP or 思维)
    2018 焦作网络赛 L Poor God Water ( AC自动机构造矩阵、BM求线性递推、手动构造矩阵、矩阵快速幂 )
    上下界的网络流模板
    计蒜客 2018南京网络赛 I Skr ( 回文树 )
    回文树 / 自动机模板
    Nowcoder 练习赛26 D xor序列 ( 线性基 )
    线性基模板
    Tarjan求强连通分量、求桥和割点模板
    Nowcoder 挑战赛23 B 游戏 ( NIM博弈、SG函数打表 )
    第二类斯特林数模板
  • 原文地址:https://www.cnblogs.com/zno2/p/5886286.html
Copyright © 2011-2022 走看看