Any good tool for browsing archives(Ear,War, Jar) on OSX

54,834

Solution 1

Any OS X ZIP utility that can open files without unpacking them will do. Alternatively, open a terminal window and type:

jar tvf <filename.jar>

You can drag the file from Finder to the Terminal window, and it will populate the filename for you. You can also pipe the output into less to scroll up and down.

jar tvf <filename.jar> | less

Solution 2

I copy it to a ".zip" file and then use my zip utilities to peek inside.

.ears, .wars, and .jars are just zip files with additional required items packed inside.

If you want to extract the contents, you can unzip them. Java contains a jar command that provides ability to zip / unzip the archives (and extra verifications that the archives are properly jar files).

Solution 3

You may also want to give Jarzilla a try.

Solution 4

If you can't already do it, make sure you can see the file extension on the *.jar. Change the name to *.zip, which will allow you to open the file as if it were a ZIP file (which it is). When you're done playing with the *.class files, change it back to *.jar so you can execute the file.

Although this is somewhat tedious, it doesn't require any new program installations and thus can be done on any computer, with or without admin rights.

Share:
54,834
Thibaut Colar
Author by

Thibaut Colar

Updated on February 13, 2020

Comments

  • Thibaut Colar
    Thibaut Colar about 4 years

    On Linux i can use file-roller and open an browse the content of an EAR file without manually open it, can even dig into contained WAR file and within that JAR files quickly.

    This is another of those must have tools I'm missing on OSX (along with meld).

    Any good tools that can do this ?

    Update: I found a tool that fits my needs : http://www.zipeg.com/

    Honorable mention to midnight commander (MC) - but it's command line (but very fast) as well as newer versions of VI (which can go into zipped files)

  • Thibaut Colar
    Thibaut Colar almost 13 years
    I know that, but that's not very convenient. I'm using this to "explore" a war/jar, and maybe pick one file deep within and open it (just that one) etc...
  • n13
    n13 over 10 years
    Wow - that's awesome. Fast and extremely convenient, just drop your JAR file on it. Has search.
  • n13
    n13 over 10 years
    Update: JarZilla doesn't work on Mavericks. Oh, well.
  • depsypher
    depsypher over 10 years
    It will work, but you need to turn off gatekeeper: Open Security & Privacy Preferences Change setting "Allow applications downloaded from" to setting "Anywhere"