46

I'd like to be able to examine the contents of a JAR file without having to install Winzip or some other tool and without having to rename the file. Windows Explorer can open ZIP files just fine; is there some registry setting I can use to let it treat JARs like ZIPs?

1
  • 4
    i wonder why this was migrated. why would anyone but a programmer be interested in this. Mar 22 '10 at 17:45
62

Or from the command line:

assoc .jar=CompressedFolder

Under Vista (or higher) you have to run this in an elevated Command Prompt.

4
  • 1
    NB: for Vista and above, you'll probably need to run the command prompt with elevated privileges i.e. as Administrator.
    – Mal Ross
    May 25 '10 at 12:45
  • works on Windows 8 as well +1. Thanks!
    – yair
    Nov 11 '13 at 19:19
  • 1
    Also works on Windows 10 in CMD. Does not work in PowerShell. While you're doing this, I suggest you do it with .ear and .war, too. Mar 3 '16 at 20:25
  • 2
    Also, assoc .jar=jarfile to restore
    – Numeron
    May 11 '17 at 10:51
4

I tried exporting HKEY_CLASSES_ROOT\.zip, changing all references of '.zip' to '.jar' and importing it to HKEY_CLASSES_ROOT\.jar.

Under Vista at least it let me open a .jar file as if it were a .zip.

3

What you need to do is associate the JAR extension in Windows Explorer with Compressed folders. From Windows Explorer select tools / Folder Options. Then the Files Types tab. Select New and associate JAR Compressed (ZIP) Folder.

0

The HKEY_CLASSES_ROOT trick doesnt work under Windows 7. There mut be some compelling reason that MSFT doesnt want us to do this.

1
  • Worked fine for me under Windows 7.
    – Brannon
    Nov 30 '09 at 4:29
0

In setting up a new Windows 10 machine this was the reason I used to install 7-zip but there is no need with this hack given by @hfrmobile.

  1. Press WinKey and type cmd
  2. Right click Command Prompt app and select Run as administrator
  3. Type assoc .jar=CompressedFolder, it should be echoed back to the screen if accepted otherwise you will get an access is denied
  4. Type assoc .ear=CompressedFolder
  5. Type assoc .war=CompressedFolder
  6. Right click a jar in Windows explorer and you should now see the Extract All... menu option available to zip files

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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