如何在调试模式下在Eclipse中运行外部工具 [英] How to run an external tool in Eclipse in debug mode

查看:137
本文介绍了如何在调试模式下在Eclipse中运行外部工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于各种原因,我的项目只能作为一个完成和打包的JAR运行(一些魔法发生在程序集中),所以我将其作为Eclipse中的一个外部工具运行。



我缺少的是调试功能。有没有办法在Eclipse中以调试模式运行外部工具?

解决方案

您可以连接到远程JVM已在调试模式下初始化。



ie在远程应用程序启动期间,您应该将参数传递给JVM类似于以下内容:
-Xdebug -Xnoagent -Xrunjdwp:transport = dt_socket,address = 6079,server = y,suspend = n



然后,您可以使用调试配置窗口,选择远程Java应用程序附加到Eclipse中的应用程序。在连接属性中,只需要主机名和端口号(我的情况下为6079)。


For various reasons my project can only be run as a finished and packaged JAR (some magic happens at assembly), so I run it as an external tool in Eclipse.

What I'm missing is debugging functionality. Is there any way of running an external tool in debug mode in Eclipse?

解决方案

You can connect to a remote JVM, if it has been initialized in the debug mode.

i.e. during the remote application startup you should pass arguments to the JVM similar to the following: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=6079,server=y,suspend=n

Then you can attach to the application in Eclipse, using the "Debug configurations" window, selecting "Remote Java Application". In the connection properties nothing more than just the host name and port number (6079 in my case) is really required.

这篇关于如何在调试模式下在Eclipse中运行外部工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆