如何找出一个类属于哪个依赖项?
我正在使用 m2eclipse。我想在新项目中重用以前项目的一些依赖项。我知道我想使用哪个类,但我似乎无法找出它到底属于哪个依赖项。如果 eclipse 只是告诉我它从中加载的 jar 的名称,我会很高兴。
我怀疑有一种方法可以在 Eclipse 中执行此操作,因为当我打开源代码时,在 Eclipse 设法加载它之前,它会显示“未找到源”页面,其中指出它试图从哪个 jar 加载它。不幸的是,它加载源代码的速度太快,所以有时我无法读取名称。
I'm using m2eclipse. I would like to reuse some of the dependencies from previous projects in a new project. I know which class I want to use, but I can't seem to find out which dependency exactly it belongs to. I would be happy if eclipse just told me the name of the jar it's loading it from.
I suspect that there is a way to do this in eclipse, because when I open the source code, before eclipse manages to load it, it shows the 'source not found' page, where it states which jar it was trying to load it from. Unfortunately, it loads the source too quickly so sometimes I don't manage to read the name.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Ctrl+Shift+T(打开类型)打开您感兴趣的类。然后,使用 Package Explorer 视图,单击双箭头图标(与编辑器链接),Package Explorer 现在应该向您显示它认为的位置该类来自。
另外,当您在 Ctrl+Shift+T(打开类型)对话框中键入类名时,您应该能够看到 Eclipse 认为该类所在的位置。
Use Ctrl+Shift+T (Open Type) to open the class you are interested in. Then, using a Package Explorer view, click on the double arrow icon (Link With Editor), the Package Explorer should now be showing you where it thinks that class comes from.
Also, while you're typing the class name in the Ctrl+Shift+T (Open Type) dialog, you should be able to see where Eclipse thinks that class is located.
对于 IntelliJ,首先查看它属于哪个 jar 文件,然后您可以使用
它显示该模块的所有依赖项,以便您可以找到其父依赖项(如果它是传递依赖项)。
For IntelliJ, first, see which jar file it belongs to, then you can use
it will show all dependencies of that module so you can find its parent dependency if it is a transitive dependency.