---
title: "通过Eclipse远程调试"
author: "clearity"
date: "2014-04-28T22:52:42Z"
tags: []
categories: ["互联网"]
slug: "eclipse"
draft: false
lastmod: "2014-04-28T22:52:42Z"
id: 2056394
url: "https://clearity.iteye.com/blog/2056394"
---

希望通过Eclipse远程调试命令行启动的程序，需要将程序设置为远程调试模式：

```
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y -jar myProgram.jar
```

 

现在打开Eclipse

```
Run > Debug Configurations... > Remote Java Application > New
```

 保证端口和命令行启动的端口一致，默认是8000，现在点击“debug”就可以了。