搜索 .jar 文件 eclipse

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1086176/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:51:39  来源:igfitidea点击:

searching through .jar files eclipse

javaeclipsejar

提问by Charles Ma

I'm porting a few java gwt projects into eclipse and the projects depends on many external .jar files, some of the dependencies seem to be dynamically linked so eclipse isn't picking up the missing links while running the ide.

我正在将一些 java gwt 项目移植到 eclipse 中,并且这些项目依赖于许多外部 .jar 文件,其中一些依赖项似乎是动态链接的,因此 eclipse 在运行 ide 时不会获取丢失的链接。

At run time, I often get exceptions that say for example 'import bar.foo.XML' is missing or some FooBar class definition is missing and it always takes me a while to figure out which .jar file these classes/libraries belong to so I can add them to the run path.

在运行时,我经常会遇到异常,例如“import bar.foo.XML”丢失或某些 FooBar 类定义丢失,我总是需要一段时间才能弄清楚这些类/库属于哪个 .jar 文件我可以将它们添加到运行路径中。

Is there a quick way to search which .jar files contain what classes and what other library they depend on?

有没有一种快速的方法来搜索哪些 .jar 文件包含哪些类以及它们依赖哪些其他库?

采纳答案by VonC

An oldie, but still good, and integrated into eclipse:

一个老歌,但仍然不错,并集成到 eclipse 中:

JarClassFinder:

罐类查找器

alt text

替代文字

Update 2013: the project still exists in a different form as an independent app JarClassFinder.
In term of Eclipse plugin, it is no longer maintained, and you only have variant like "BundleclassFinder".

2013 年更新:该项目仍然以不同的形式作为独立应用程序JarClassFinder 存在
就Eclipse插件而言,它不再维护,您只有“ BundleclassFinder”之类的变体。

Other (manual) ways to find a class within jars: "Java: How do I know which jar file to use given a class name?"

在 jars 中查找类的其他(手动)方法:“ Java:我如何知道给定类名要使用哪个 jar 文件?

回答by kgiannakakis

You need a tool like Jar Analyzer

你需要一个像Jar Analyzer这样的工具

回答by Thorbj?rn Ravn Andersen

Can't you just mark all the jar-files in Eclipse and right-click->add to Build Path?

你不能只标记Eclipse中的所有jar文件并右键单击->添加到构建路径吗?