aspose file tools*
The moose likes Beginning Java and the fly likes How do you Unzip a JAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do you Unzip a JAR file" Watch "How do you Unzip a JAR file" New topic
Author

How do you Unzip a JAR file

Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi All
How do you unzip a Jar file ???
Do you require specific softwar. Simply double clicking does not
work.
I want to unzip the src.jar file which is part of the JDK.
Thanks in advance.
Bruce Wingate
Ranch Hand

Joined: Feb 16, 2001
Posts: 32
I use WinZip, but PKZip or gunzip should work fine. You might need to play with the extensions for gunzip.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
If you have the JDK installed, do the following at the DOS prompt.
jar xvf yourjarfile.jar
You can also try winzip.
Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi
Bosun, your command is not recognised in the dos prompt.
I am running this command in the directory the file is in.
Any other suggestions ???
Thanks in advace.
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
you need to set your PATH environment variable. i'm no windows
guy, but i think how you do it depends on whether you're using
NT or 98.
PATH tells your system where to look for executables (such as
jar) when you try to run them from the command line (err,.. dos
prompt.)
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
whoops. i assumed you already have the java2 sdk installed.
when you install the sdk, the jar program comes with it.
Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi
I DO have the Java2 SDK installed but I am not familiar with it.
Which directory is the JAR program. How do I use it ??
Where can I find out how to set the PATH environment variable ??
Thanks in Advance.
Siva Prasad
Ranch Hand

Joined: Feb 22, 2001
Posts: 104

Hi Zahid
If you are using windows, open a DOS window and type PATH
It will show the current PATH. Check in that list, whether your JDK1.2.2/bin directory is there or not. This is where all your java compiler and other utilities exists.
If not add this
<drive>JDK1.2.2/bin like this
for eg. if your JDK is installed under C:\JDK1.2.2
SET PATH=C:\JDK1.2.2\bin;%PATH%;
Cheers
Siva Prasad
Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi
Thanks Siva. The command worked and I now have the jar file uncompressed.
By the way is "jar xvf filename.jar" a dos command ???
If so I need to polish up my DOS commands
Thanks ALL.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
No, "jar xvf filename.jar" is not a DOS command. It's a command used with the jar tool. I saw it in Java in a nutshell.
Bosun
Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi ALL
Thanks Bosun. Would you recommend Java in a Nutshell as a book to buy ?? What level of programmer is it written for ??
Thanks in advance.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Zahid, it's a good book. You may want to check out it's reviews at Amazon or bookpool. It's the first Java book I read, I have it right at my desk at work, because it's also a good reference. It's probably best suited for someone whos is already familiar with C/C++ or some other programming language. Another book I use a lot is Ivor Horton's Beginning Java 2. Both books were also helpful with getting my certification.
Bosun
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
There is a whole bunch of book review at the BunkHouse:
http://www.javaranch.com/books.jsp


"JavaRanch, where the deer and the Certified play" - David O'Meara
Zahid, Butt
Ranch Hand

Joined: Feb 16, 2001
Posts: 100
Hi ALL
Thanks for the advice Bosun.
Thanks to All that have contributed.
Zahid.
Bruce Wingate
Ranch Hand

Joined: Feb 16, 2001
Posts: 32
Java In a Nutshell
I haven't read this one, but in general, I found the nutshell books good, but not for learning. They work best when you have some basis in the language/topic so that you know where to start from.
Bruce.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

A great tool I found is powerarchiver it will compress/uncompress any type of compressed file(zip jar tar etc etc). you can get it free at http://powerarchiver.com/


SCJP
Visit my download page
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do you Unzip a JAR file