在Java jar中查找所有依赖项的工具 [英] Tools for finding all dependencies in Java jars

查看:92
本文介绍了在Java jar中查找所有依赖项的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可以提供类路径或文件夹的工具,并且可以搜索所有.jar文件以查找对特定类的引用?

Are there any tools that can be given a classpath or folder, and will search through all the .jar files looking for references to a particular class?

为解决这类问题,使我节省了一天的搜索时间。

It would have saved me a day of searching in order to resolve this kind of problem.

在我的情况下,我不得不找出对类的流氓引用来自哪里,因为由于 NoClassDefFoundError 。我想我正在寻找这个东西:

In my case I had to find out where a rogue reference to a class was coming from, as it was stopping JBoss from starting correctly due to a NoClassDefFoundError. I suppose I am looking for this:

java -jar magicbullet.jar /path/to/search com.myproject.DodgyClass
Searching...
com.problematic.Otherclass in /path/to/search/dodgy.jar implements com.myproject.DodgyClass

或类似。否则,我会写一个。

Or similar. If not, I'll write one.

推荐答案

使用Tattletale- http://www.jboss.org/tattletale 。它可以帮助您创建一个非常便于搜索类的索引。

Use Tattletale - http://www.jboss.org/tattletale. It helps you create an index which is very handy to search for classes etc.

这篇关于在Java jar中查找所有依赖项的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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