如何分析Java程序中使用的jar文件? [英] How to analyse which jar file is used in a Java program?

查看:75
本文介绍了如何分析Java程序中使用的jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有一个名为callme.jar的jar文件

Suppose there is a jar file named callme.jar

并且它位于多个目录中,

and it's located in several directories,

如何分析在运行时使用哪一个?

how to analyse which one of them is used at run-time?

推荐答案

调用 java 可执行文件,带有 -verbose:class 参数。这将产生如下输出:

Invoke the java executable with the -verbose:class argument. This will produce output like:


[从文件中加载org.apache.log4j.helpers.ThreadLocalMap:/ C:/.../ 1.2.14 / log4j-1.2.14.jar]

[从文件中加载org.apache.commons.cli.Option:/ C:/.../ commons-cli-1.2.jar]

[Loaded org.apache.log4j.helpers.ThreadLocalMap from file:/C:/.../1.2.14/log4j-1.2.14.jar]
[Loaded org.apache.commons.cli.Option from file:/C:/.../commons-cli-1.2.jar]

这篇关于如何分析Java程序中使用的jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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