15

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?

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".

10 Answers 10

15

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

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/309173 for more details

2
  • huh...there was more there than the link above in my response...but anyways...you're just tagging the extension with the plain text filter
    – curtisk
    May 18, 2009 at 18:40
  • @curtisk Right, better to search for the PersistentHandler of zip files and add that to the default entry.
    – Jan
    Apr 9, 2019 at 15:40
5

I would also recommend total commander. It is a great file management tool with great search functionality which can easily look inside jar files.

3
  • I've started trying Agent Ransack which seems similar. May 18, 2009 at 18:02
  • Agent Ransack does NOT search for filenames inside JAR,ZIP and other archives.
    – Juraj
    Nov 4, 2011 at 10:17
  • I tried total commander, it does not find any text in the jar at all!
    – user387184
    Feb 14, 2014 at 22:24
2

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.

You might find this helpful instead: http://jarbrowser.sourceforge.net/

1
  • Interesting. I thought there might be a registry entry to enable it. May 18, 2009 at 17:46
2

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/

3
  • yeah, thanks for sharing, but it looks like the build for that project is bad - there isn't anything in the jar in the download section. The source is here I may just put it up on GitHub ;) Apr 20, 2012 at 19:04
  • I've submitted an issue, we'll see if he corrects it. here Apr 20, 2012 at 19:07
  • I've forked the project on github, cleaned it up a little and built it. See my response below. Apr 20, 2012 at 22:27
2

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

1
  • This worked for me, although it didn't seem to support wildcard searches, only substring searches.
    – barfuin
    Dec 15, 2020 at 13:16
1

According to this MSDN Channel 9 article, adding an appropriate IFilter will do it. Since .jar files are the same as .zip files, one of the four ZIP file IFilters they list might work (unless they are all extension-based).

1

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}"
1

I know that it's not Windows Search, but I have long used Agent Ransack for this: it is very quick and searches through all the various java archive formats (jar, war, ear) as well as 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.

2
1

As suggested by @iubing, the FindClassInJars code works fairly well, but the author must have botched the packaging.

I've forked the FindClassInJars util from google code, you can get a built copy here that works. Just click the "raw" button.

0

a while back I developed this: https://github.com/javalite/jar-explorer just for the occasion. works even on windows :)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.