This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Unjar.........????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Unjar.........?????" Watch "Unjar.........?????" New topic


Ramakrishnan Ramaswamy

Joined: Mar 02, 2001
Posts: 2
Is there any way to xtract the files in ajar file .Like i have a jar file having a number of class files in it .Now how do i get the class files out .Is there any way to do this in jdk or do i have to get any seperste software for it.???
ali farid
Ranch Hand

Joined: Aug 26, 2000
Posts: 60
you can use this command
jar -xvf <filename>
jar -xvf src.jar
for help on jar command type jar -help
ali farid
Ranch Hand

Joined: Aug 26, 2000
Posts: 60
or there is an easier way
re name .jar to .zip and unzip it
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Winzip utility can read .jar file without renaming. Just open the jar file, extract.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I think the renaming was suggested because recent Java SDK installations map the "open" operation of Jar files to run the jar, so just clicking on the jar file will probably not do anything useful.
The long-term solution is to add an action to the Jar file type which opens it using winzip. I have done this, and it works well. I can just right-click on a jar file and select "unzip" and it opens in WinZip for me.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Unjar.........?????
Similar Threads
why does javac create 2 class files
How to include third party jar files with in manifest file.
Jar Question
When to declare mapping resources in hibernate configuration files
custom tag