User Tools

Site Tools


How to search inside a Jar file


Sometimes it is useful to detect if a certain class is inside a jar file without the tedious process of rename it to .zip, uncompress and make a search.

It is possible to instruct windows to do the search inside a jar file with a simple change in the registry.

Here are the instructions:

And, for the sake of not loosing the key data, here are the registry key that must be created. This is the dump of a registry file, so if you just create file called “something.reg” with this data, and double click on it, the information will be incorporated to your registry file and voilá!! search inside a jar is implemented.

You have to re-login to the computer for make this to work.

Windows Registry Editor Version 5.00

Other option

I've tried the first one and it didn't work, but this one, despite being a command line tool, works very fine:

I've created a batch file for run it more easily (see below). I've changed the name to grepjar because I am more accustomed to this sintax.

@echo off
rem grepjar.bat - wrapper for jarscan.jar file
set "bindir=%~dp0%"
if "%*" == "" goto help
java -jar "%bindir%jarscan.jar" -dir "%1" -class "%2" 
goto exit
echo Usage: grepjar directory class-to-search


java/searchinsideajarfile.txt · Last modified: 2022/12/02 22:02 by