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 ...
随机推荐
- Task.WaitAll代替WaitHandle.WaitAll
Task.Waitall阻塞了当前线程直到全完.whenall开启个新监控线程去判读括号里的所有线程执行情况并立即返回,等都完成了就退出监控线程并返回监控数据. task.Result会等待异步方法返 ...
- C# 通过api函数GetPrivateProfileString读取ini文件,取不到值
通过api函数GetPrivateProfileString读取ini文件,取不到值,测试了好长时间,都不行 确认程序,ini文件都没有错误的情况,最后发现是ini文件编码的原因. 将ini文件的编码 ...
- Jenkins+svn+maven自动部署到tomcat
jenkins所在主机配置好,jdk,maven,Tomcat 1.配置maven,jdk环境 1) 进入配置界面--->[系统管理]--->[Global Tool Configurat ...
- linux系统web站点设置-http基础设置
一.httpd2.2的组成: /etc/httpd:服务器的根目录 conf/httpd.conf,conf.d/*:配置文件 conf/magic:MIME的配置文件 logs:日志文件的存放路径, ...
- Centos安装配置Postfix邮件服务器--网址
http://www.haiyun.me/archives/centos-install-postfix.html http://blog.csdn.net/liuyunfengheda/articl ...
- Java Http接收中文乱码解决
当时url传递时,可用 byte[] bytes=reqdata_s.getBytes("ISO-8859-1"); String name=new String(bytes,&q ...
- [ ZooKeeper]ZooKeeper 的功能和原理
Zookeeper功能简介: ZooKeeper 是一个开源的分布式协调服务,由雅虎创建,是 Google Chubby 的开源实现.分布式应用程序可以基于 ZooKeeper 实现诸如数据发布/订阅 ...
- 室内设计类网站Web原型制作分享——Dinzd
Dinzd是一家德国室内设计网站,网站内涵盖全球设计精品资讯以及优秀案列.网站布局简单直观,内容丰富. 此原型模板所用到的交互动作有结合弹出面板做下拉菜单效果,鼠标按下文字按钮跳转页面,按钮hover ...
- Sliding Window Maximum LT239
Given an array nums, there is a sliding window of size k which is moving from the very left of the a ...
- 微信小程序swiper制作内容高度不定的tab选项卡
微信小程序利用swiper制作内容高度不定的tab选项卡,不使用absolute定位,不定高度,由内容自由撑开主要思路是获取内容区的高度来给swiper动态设置值 .wxml <view cla ...