Remote Debugging (2)
use Eclipse| a Java application
创建一个简单的maven项目

Main.java
package cn.zno;
public class Main {
public static void main(String[] args) {
for (String arg : args) {
System.out.println(arg);
}
}
}
Main.java
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.zno</groupId>
<artifactId>za</artifactId>
<version>1.0</version> <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
pom.xml
Building jar
右键项目

[INFO] Building jar: F:\e\workspacetest\za\target\za-1.0.jar
以调试模式远程启动
F:\>java -cp F:\e\workspacetest\za\target\za-1.0.jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend
=y cn.zno.Main a b c
Listening for transport dt_socket at address: 8000
_
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y
现在处于挂起状态,等待debugger 启动
启动debugger





配置需要调试的项目,Host 和 Port
其中Host 是远程电脑的ip ,Port 为远程电脑debug模式指定的端口
然后在progress中打好断点,启动Debug,便可进入到断点调试中(如下图)

可以调试了~
最终结果:
F:\>java -cp F:\e\workspacetest\za\target\za-1.0.jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend
=y cn.zno.Main a b c
Listening for transport dt_socket at address: 8000
a
b
c
编译时的debug信息

如果不勾选line number 调试过程中会出现这种错误:

Remote Debugging (2)的更多相关文章
- 在chrome 总调试cordova出现Detached from the target. Remote debugging has been terminated with reason: Connection lost. Please re-attach to the new target
在chrome 总调试cordova出现如下错误: "Detached from the target. Remote debugging has been terminated with ...
- 转:Remote debugging with Visual Studio 2010
Original URL http://www.codeproject.com/Articles/146838/Remote-debugging-with-Visual-Studio-2010 you ...
- Remote Debugging (1)
The client/server design of the Java debugger allows you to launch a Java program from computer on y ...
- JPDA and Set up Tomcat for Remote Debugging
* About JPDA (http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/architecture.html) JPDA: (J ...
- 安卓手机移动端Web开发调试之Chrome远程调试(Remote Debugging)
一.让安卓打debug模式的apk包 二.将电脑中的chrome升级到最新版本,在chrome浏览器地址栏中输入chrome://inspect/#devices: 在智能手机还未普及时,移动设备的调 ...
- Android WebView remote debugging
/***************************************************************************** * Android WebView rem ...
- Android/iOS Remote debugging
简单介绍 使用下面方法可以定位webview中的元素,无法定位view中的元素. 原文地址:http://mp.weixin.qq.com/s/y_UfdgjT_pkKgYivJmqt7Q webvi ...
- Remote Debugging Android Devices
Remote Debugging Android Devices //在电脑上远程调试安卓设备 By Kayce Basques Technical Writer at Google By Meggi ...
- 通过Chrome浏览器进行android调试/Remote Debugging on Android with Chrome
The way your web content behaves on mobile can be dramatically different from the desktop experience ...
- PyCharm 2017: Remote debugging using remote interpreter doesn't work
I set up a remote interpreter and verified that I can run a script using the remote interpreter. Con ...
随机推荐
- docker搭建lnmp(二)
上一篇利用 不同的命令来构建 nginx,mysql,php镜像 和 容器. 这样做比较麻烦,也很容易出错,当然可以写入 sh脚本来执行.但是可以通过 docker-compose 来达到效果,管理起 ...
- 视觉slam十四讲
对这个的学习一直都在,感觉到了这本书很强大呀!!! ch2---安装ubuntu:安装kdevelop. ch3---安装eigen3---几何模块:安装Pangolin可视化. ch4---安装So ...
- 2D情况下,复数的意义代表旋转
4 x i x i = - 4 就是"4"在数轴上旋转了180度. 那么4 x i = 4i 就旋转了90度. 复数的意义就表示旋转 乘以-1,表示x正半轴的数,围绕原点,逆时针偏 ...
- 使用vim编程步骤
先用vim 名字.cpp //创建一个.cpp文件进行代码编写 可以调用g++ 名字.cpp的形式进行编译,更好的方法是采用CMakeLists.txt touch CMakeLists.txt // ...
- PAT 1036 跟奥巴马一起编程(15)(代码)
1036 跟奥巴马一起编程(15)(15 分) 美国总统奥巴马不仅呼吁所有人都学习编程,甚至以身作则编写代码,成为美国历史上首位编写计算机代码的总统.2014年底,为庆祝"计算机科学教育周& ...
- CH6802 車的放置
原题链接 和棋盘覆盖(题解)差不多. 将行和列看成\(n+m\)个节点,且分属两个集合,如果某个节点没有被禁止,则行坐标对应节点向列坐标对应节点连边,然后就是求二分图最大匹配了. #include&l ...
- RAPID程序设计
1.ABB机器人软件 RobotWare 是ABB提供的机器人系列应用软件的总称. RobotStudio是ABB公司自行开发的机器人模拟软件, 能在PC机上模拟几乎所有型号的ABB 机器人几乎所有的 ...
- tmux 快捷操作
-- 基本使用 tmux # 运行 tmux -2 以256终端运行 C-b d # 返回主 shell , tmux 依旧在后台运行,里面的命令也保持运行状态 tmux ls # 显示已有tm ...
- postfix 设置邮件头翻译,本域邮件不进行邮件头翻译,仅发送至外网的进行邮件头翻译?
postfix 设置邮件头翻译,本域邮件不进行邮件头翻译,仅发送至外网的进行邮件头翻译? 现在设置的 smtp_generic_maps = hash:/etc/postfix/generic sen ...
- POJ 3469.Dual Core CPU 最大流dinic算法模板
Dual Core CPU Time Limit: 15000MS Memory Limit: 131072K Total Submissions: 24830 Accepted: 10756 ...