当jar不在类路径上时,如何将第三方jar的源绑定到eclipse进行调试 [英] How can I bind sources of 3rd party jar to eclipse for debugging when jar is not on the class path

查看:137
本文介绍了当jar不在类路径上时,如何将第三方jar的源绑定到eclipse进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用了第三方的开源jar。我在Eclipse中开发应用程序。该jar实际上不在应用程序的类路径上,它由依赖注入框架(OSGI Felix)动态加载。



我有jar的来源,但是不要建立它。



如何将源绑定到Eclipse中的jar,以便我可以通过该jar的代码来进行断点和调试? / p>

如果jar在类路径上,我认为是不同的,所以我强调这个事实。

解决方案

当您在Eclipse中进入您的方法时,如果您没有该jar的源代码,那么最终将会出现此编辑器窗口:





只需点击 Attach Source .. 按钮,然后选择包含源代码的jar。您可以在方法中放置断点和步骤。


I am using a 3rd party, open-source jar in my application. I develop the application in Eclipse. The jar is actually not on the classpath of the application, it is dynamically loaded by dependency injection framework (OSGI Felix here).

I have sources of the jar, but I do not want to build it.

How to to bind the sources to the jar in the Eclipse, so that I can put breakpoints and debug through code of this jar?

I think that differs if the jar is on the classpath, so I stress this fact.

解决方案

When you step into your method in Eclipse, if you don't have the source code of the jar you'll end up with this editor window:

Just click the Attach Source.. button, and then select your jar that contains the source code. You'll be able to put break points and step inside the methods.

这篇关于当jar不在类路径上时,如何将第三方jar的源绑定到eclipse进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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