检查类用于编译&执行(运行时)

发布于 2025-01-21 08:13:22 字数 194 浏览 3 评论 0 原文

我是一个非常大的项目,其中成千上万的课程使用了100台第三方罐子。

我需要找出项目中每个类别使用的罐子的列表以及执行过程中,即运行时。

我该如何实现?很难手动检查很多类,因此我更喜欢一些Eclipse/Intellij Idea插件,这些插件可以为我提供一个报告或任何类型的脚本,这些脚本可以创建类使用的类与JARS的列表。

谢谢。

I've a very big project where thousands of classes are using 100s of third party jars.

I need to find out list of jars used by every single class in the project for compilation as well as during execution, i.e. runtime.

How can I achieve it? It is difficult to manually inspect this many classes so I would prefer some Eclipse/IntelliJ IDEA plugin which can give me a report or any type of script that can create list of classes vs jars used.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一瞬间的火花 2025-01-28 08:13:22

您可以使用Intellij Idea来做到这一点。这真的很简单。
从主菜单中,选择代码 - >分析代码 - > Dependencies

enter image description here

Then select Whole Project and press Analyse

enter image description here

Finaly a window open at the bottom of IDEA and on the right side you can see all dependency used in the project.

All you have to do is navigate in your project (left part) and click on the class for which you want to know the dependency used ;)

PS: You can also Analyse only one classe to see all她使用的依赖性,由Usong定制范围(只需选择您的课程)

You can do that with IntelliJ IDEA. It's really simple.
From the main menu, select Code -> Analyze Code -> Dependencies

enter image description here

Then select Whole Project and press Analyse

enter image description here

Finaly a window open at the bottom of IDEA and on the right side you can see all dependency used in the project.

enter image description here

All you have to do is navigate in your project (left part) and click on the class for which you want to know the dependency used ;)

PS: You can also Analyse only one classe to see all the dependency she used, by usong the custom scope (just select your classes)

七七 2025-01-28 08:13:22

我建议您在Java命令执行中添加 -verbose:class 。这将散发出运行时加载的任何类,并从中加载罐子。与Intellij的代码分析工具不同,此方法还将适用于使用反射加载的类。

I suggest you add -verbose:class to your java command execution. This will emit any class being loaded during runtime, and the jar it was loaded from. Unlike the code analysis tool from IntelliJ, this method will also work for classes loaded using reflection.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文