如何找到jar中定义的包? [英] How do I find the packages defined in a jar?

查看:113
本文介绍了如何找到jar中定义的包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆JAR文件(来自maven2项目)和maven报告无法找到一些包(确切地说是org.openanzo.client.jena)。我想深入研究作为maven依赖项解析结果下载的JAR文件,并从这些JAR文件中找到可用的包。洞察力?

I have a bunch of JAR files (from a maven2 project) and maven reports some package could not be found (org.openanzo.client.jena to be exact). I want to dig into the JAR files downloaded as the result of maven dependency resolution and find what packages are thus available from these JAR files. Insights?

更新:显然,检查jar文件内部的唯一好方法是jar实用程序,或者可以使用其IDE的工具来执行此操作。

UPDATE: Apparently, the only good solution to inspect insides of a jar file is the "jar" utility or one can use the facilities of their IDE to do so.

推荐答案

jar tvf filename.jar 将显示内容一个jar文件,不需要你提取它。

jar tvf filename.jar will show you the contents of a jar file without requiring you to extract it.

但我认为你真正想要做的就是找到你所缺少的依赖关系的正确坐标,因为很明显你现在没有提供你正在寻找的包裹(换句话说,检查它们的内容不太可能帮助你)。

But I think that maybe what you are really trying to do is find the right coordinates for the dependency that you are missing, since obviously none of the ones you have right now are supplying the package you are looking for (in other words, checking their contents is not likely to help you).

I承认我建议检查的第一个地方是Sonatype的公共Nexus实例。但是,搜索您的示例却没有任何结果。通常这意味着项目不是试图将他们的东西放到Maven Central或其他主要的存储库(这没关系),所以你必须求助于网络搜索。通常包的前两部分会告诉你在哪里看(在你的情况下是openanzo.org)。

I confess that the first place I would suggest to check is Sonatype's public Nexus instance. A search for your example turns up nothing, though. Usually that means the project is not trying to get their stuff into Maven Central or other major repositories (which is okay), so you have to resort to a web search. Usually the first two sections of the package tell you where to look (openanzo.org in your case).

这篇关于如何找到jar中定义的包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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