如何使用 Windows Search 搜索 Jar 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/878769/
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
How to search Jar files using Windows Search?
提问by Marcus Leon
I believe back when we were on Win2K, Windows Search would search through Jar files to locate specific classes but this doesn't appear to work in XP. Does anyone know how to enable this in XP?
我相信当我们使用 Win2K 时,Windows Search 会搜索 Jar 文件来定位特定的类,但这在 XP 中似乎不起作用。有谁知道如何在XP中启用它?
Note, to do the search in Win2K we just entered *.jar for the files and "ClassABC" for the search text string and the search would return any jar files containing class files where the title contained "ClassABC".
注意,要在 Win2K 中进行搜索,我们只需输入 *.jar 文件和“ClassABC”搜索文本字符串,搜索将返回包含标题包含“ClassABC”的类文件的任何 jar 文件。
采纳答案by curtisk
Add this to a text file, save file, change the extension to .reg, double click to add to registry and you should be ok...you can search on file name or content and it should show jars that have class names
将此添加到文本文件,保存文件,将扩展名更改为 .reg,双击以添加到注册表,您应该没问题...您可以搜索文件名或内容,它应该显示具有类名的 jar
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
The only thing left is to logout and log back into windows and it should work fine for you, see http://support.microsoft.com/kb/309173for more details
剩下的唯一事情就是注销并重新登录到 Windows,它应该可以正常工作,有关更多详细信息,请参阅http://support.microsoft.com/kb/309173
回答by neesh
I would also recommend total commander. It is a great file management tool with great search functionality which can easily look inside jar files.
我也推荐总司令。它是一个很棒的文件管理工具,具有强大的搜索功能,可以轻松查看 jar 文件。
回答by SpliFF
If it was removed it was likely due to the Sun-Microsoft Java dispute that was going on around the time XP was developed. It's unlikely to have a way of re-enabling it.
如果它被删除,很可能是由于在开发 XP 时发生的 Sun-Microsoft Java 争端。不太可能有办法重新启用它。
You might find this helpful instead: http://jarbrowser.sourceforge.net/
您可能会发现这有帮助:http: //jarbrowser.sourceforge.net/
回答by Liubing
Just use FindClassInJars util, it's a simple swing program, but useful. You can check source code or download jar file at http://code.google.com/p/find-class-in-jars/
只需使用 FindClassInJars util,它是一个简单的摆动程序,但很有用。您可以在http://code.google.com/p/find-class-in-jars/查看源代码或下载 jar 文件
回答by mtpettyp
From Brenden Anstey's Blog:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.jar]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"
[HKEY_CLASSES_ROOT\.jar\CompressedFolder]
[HKEY_CLASSES_ROOT\.jar\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.jar\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.jar\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.war]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"
[HKEY_CLASSES_ROOT\.war\CompressedFolder]
[HKEY_CLASSES_ROOT\.war\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.war\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.war\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"
[HKEY_CLASSES_ROOT\.ear]
"Content Type"="application/x-zip-compressed"
"PerceivedType"="compressed"
@="CompressedFolder"
[HKEY_CLASSES_ROOT\.ear\CompressedFolder]
[HKEY_CLASSES_ROOT\.ear\CompressedFolder\ShellNew]
"Data"=hex:50,4b,05,06,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
[HKEY_CLASSES_ROOT\.ear\OpenWithProgids]
"CompressedFolder"=""
[HKEY_CLASSES_ROOT\.ear\PersistentHandler]
@="{098f2470-bae0-11cd-b579-08002b30bfeb}"
回答by Robert Mark Bram
I know that it's not Windows Search, but I have long used Agent Ransackfor this: it is very quick and searches through all the various java archive formats (jar, war, ear) as well as zip.
我知道它不是 Windows 搜索,但我长期以来一直使用Agent Ransack来解决这个问题:它非常快,可以搜索所有各种 Java 存档格式(jar、war、ear)以及 zip。
A feature that I particularly like and use a lot is saving a search: you can save the criteria (so that you can repeat that search easily) or the results.. So when I am working on a project, I will often want to search through the project directory tree for a file (or a file within a jar/zip). I perform the search once and save the criteria as a .srf file, which I can open quickly to perform similar searches afterwards.
我特别喜欢并经常使用的一个功能是保存搜索:您可以保存条件(以便您可以轻松地重复该搜索)或结果。通过文件(或 jar/zip 中的文件)的项目目录树。我执行一次搜索并将条件保存为 .srf 文件,我可以快速打开该文件以在之后执行类似的搜索。
回答by Michael Myers
According to this MSDN Channel 9 article, adding an appropriate IFilterwill do it. Since .jar files are the same as .zip files, one of the fourZIPfileIFiltersthey list might work (unless they are all extension-based).
根据这篇 MSDN 频道 9 文章,添加适当的IFilter 即可。由于 .jar 文件与 .zip 文件相同,因此它们列出的四个ZIP文件IFilter 之一可能会起作用(除非它们都基于扩展名)。
回答by Oxvalley
I made another version of FindClassInJars here. It is the same look but searches a little better and smarter. Click the "Raw button here: https://github.com/Oxvalley/FindClassInJars/blob/master/lib/findclassinjars-2.0.0.jar
我在这里制作了另一个版本的 FindClassInJars。它是相同的外观,但搜索更好,更智能。单击此处的“原始按钮:https: //github.com/Oxvalley/FindClassInJars/blob/master/lib/findclassinjars-2.0.0.jar
回答by ipolevoy
a while back I developed this: https://github.com/javalite/jar-explorerjust for the occasion. works even on windows :)
不久前我开发了这个:https: //github.com/javalite/jar-explorer只是为了这个场合。即使在 Windows 上也能工作 :)
回答by javamonkey79
As suggested by @iubing, the FindClassInJars code works fairly well, but the author must have botched the packaging.
正如@iubing 所建议的, FindClassInJars 代码运行得相当好,但作者一定是把包装搞砸了。
I've forked the FindClassInJars util from google code, you can get a built copy herethat works. Just click the "raw" button.
我已经从谷歌代码分叉了 FindClassInJars 实用程序,你可以在这里获得一个有效的构建副本。只需单击“原始”按钮。