This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to Unjar   a Jar File? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to Unjar   a Jar File?" Watch "How to Unjar   a Jar File?" New topic
Author

How to Unjar a Jar File?

Emmanuel Bakare
Greenhorn

Joined: Jun 13, 2001
Posts: 19
I need Help to un jar the SCJD Assignment.
I have read the java tutorial on this , but I still can't do it . Whenever I typed the command in the command prompt. I get a message " BAD COMMAND". I changed directory to JDK FILE , I still can't do it . I need someone to help me.
Regards,
Emmanuel Bakare.
Damian Ryan
Ranch Hand

Joined: May 09, 2003
Posts: 117
There are a few ways to do it.
One way is to use the command line "jar" tool.
For example, if your JAR file is called "abc.jar", to extract its contents you would type:
jar xf abc.jar
this would then unpackage the contents of the jar into your current directory.
Note that for this to work, the "jar" executable must be in your PATH environment variable.
(On Windows, if your JDK were in "C:\j2sdk1.4.1_02", the entry "C:\j2sdk1.4.1_02\bin" should be appended to your PATH environment variable [you can do this manually from your command window by typing "SET PATH=%PATH%;C:\j2sdk1.4.1_02". On Linux/Unix, if your JDK were in /j2sdk1.4.1_02, you could append it your path (in a bash shell) by typing "EXPORT PATH=$PATH:/j2sdk1.4.1_02/bin").
Alternatively you can use WinZip on Windows, or the file-roller on Linux, or any one of a number of other graphical utilities.
Unix/Linux-philes will have more specific advice about those environments, I'm sure.
Hope this helps.
[ May 20, 2003: Message edited by: Damian Ryan ]
[ May 20, 2003: Message edited by: Damian Ryan ]

Always proofread carefully to see if you any words out.
Emmanuel Bakare
Greenhorn

Joined: Jun 13, 2001
Posts: 19
Thanks Damien for your help. I was not aware you can use winzip to unjar the file.
I have just unjar the file now.
Thanks oce again.
Regards,
Emmanuel Bakare
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Unjar a Jar File?
 
Similar Threads
URLyBird questions
JSR 82, WTK2.1 and WTK2.2 issues
jar file
SCJP 6 - Chapter 10 : Development
replaceregexp workaround/bug