14

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

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429

10 Answers10

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

curtisk
  • 19,950
  • 4
  • 55
  • 71
  • 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 '09 at 18:40
  • @curtisk Right, better to search for the PersistentHandler of zip files and add that to the default entry. – Jan Apr 09 '19 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.

neesh
  • 5,167
  • 6
  • 29
  • 32
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

Oxvalley
  • 21
  • 1
  • This worked for me, although it didn't seem to support wildcard searches, only substring searches. – barfuin Dec 15 '20 at 13:16
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/

Liubing
  • 51
  • 2
  • 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](http://find-class-in-jars.googlecode.com/svn/trunk/FindClassInJars/src/net/learningandroid/findinjar/FindClass.java) I may just put it up on GitHub ;) – javamonkey79 Apr 20 '12 at 19:04
  • I've submitted an issue, we'll see if he corrects it. [here](http://code.google.com/p/find-class-in-jars/issues/detail?id=1) – javamonkey79 Apr 20 '12 at 19:07
  • I've forked the project on github, cleaned it up a little and built it. See my response below. – javamonkey79 Apr 20 '12 at 22:27
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/

SpliFF
  • 38,186
  • 16
  • 91
  • 120
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.

Community
  • 1
  • 1
javamonkey79
  • 17,443
  • 36
  • 114
  • 172
1

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

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
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.

Robert Mark Bram
  • 8,104
  • 8
  • 52
  • 73
  • Agent Ransack does NOT search for filenames inside JAR,ZIP and other archives, see here: http://www.mythicsoft.com/page.aspx?page=features&type=agentransack – Juraj Nov 04 '11 at 10:18
  • Sorry to disappoint you @Juraj but it does. Here is my sample zip file: http://i.imgur.com/Lyhdv.jpg and here is Ransack successfully searching for a file name within it: http://i.imgur.com/EQEkE.jpg. Ransack can search the contents of the zip/jar etc (i.e. the names of the files in the archive), but doesn't search the contents of files within the zip/jar/etc. – Robert Mark Bram Nov 05 '11 at 12:02
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).

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
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}"
mtpettyp
  • 5,533
  • 1
  • 33
  • 33