简体   繁体   English

如何在调试模式下在Eclipse中运行外部工具

[英]How to run an external tool in Eclipse in debug mode

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. 由于各种原因,我的项目只能作为完成和打包的JAR运行(在程序集中会发生一些神奇的事情),所以我将它作为Eclipse中的外部工具运行。

What I'm missing is debugging functionality. 我缺少的是调试功能。 Is there any way of running an external tool in debug mode in Eclipse? 有没有办法在Eclipse中以调试模式运行外部工具?

You can connect to a remote JVM, if it has been initialized in the debug mode. 如果已在调试模式下初始化,则可以连接到远程JVM。

ie 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 即在远程应用程序启动期间,您应该将参数传递给JVM,类似于以下内容: -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". 然后,您可以使用“调试配置”窗口连接到Eclipse中的应用程序,选择“远程Java应用程序”。 In the connection properties nothing more than just the host name and port number (6079 in my case) is really required. 在连接属性中,实际上只需要主机名和端口号(在我的情况下为6079)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM