Extracting files (specifically .png) from .jar files using 10.6

Ok, so basically I'm a complete idiot and I don't have any idea what the heck I'm doing but I do know that .jar files can contain other files and certain applications or tools can help extract those files. I am trying to extract a .png file from a .jar file and then edit it and reinsert it and I have been looking for a tool competent enough to do this but I haven't been able to. Have any pointers? (AKA links, programs, etc.) Thanks!

MacBook (2008 Aluminium), Mac OS X (10.5.8)

Posted on Mar 11, 2011 7:25 AM

Reply
4 replies

Mar 11, 2011 8:18 AM in response to Quinn Oak

'JAR' stands for 'Java Archive'. In fact, it's actually a zip file with a specific layout of the files within it. You can simply change the suffix from .jar to .zip and uncompress it to see all the files inside. You could also use the 'jar' command in terminal to uncompress it.

Simply uncompress the jar file, make any changes, and compress it again. There are no special tools needed.

In the shell (Terminal.app):


mkdir x
cd x
jar xf ../jarfile.jar
mv ../myimage.png ./some/file/path/something.png
jar cf ../jarfile2.jar .

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Extracting files (specifically .png) from .jar files using 10.6

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.