PDA

View Full Version : how to unzip/untar war files



adhg
August 18th, 2007, 01:04 AM
Hi all,
I'm trying to write a shell that unzip a war file. I wonder what is the command line to unzip?
So far I've been doing that with the GUI "archive manager". I tried unzip /home/xian/Desktop prj.war
but the return result was:

unzip: cannot find or open /home/xian/Desktop/Runway.war, /home/adhg/Desktop/Runway.war.zip or /home/adhg/Desktop/Runway.war.ZIP.

any idea?

slavik
August 18th, 2007, 04:50 AM
jar xf prj.war

this might work (not tested)


tar zxf prj.war

kalikiana
August 18th, 2007, 08:36 PM
I suggest you try these commands as well. ;)


man unzip


man tar

adhg
August 19th, 2007, 04:20 AM
thank you all for your help.
As I am a complete newbie to Linux, As suggested by kalikiana I tried the command line:

adriana@ubuntu:~$jar /home/adhg/Desktop/Runway.war

and the result came in as:

The program 'jar' can be found in the following packages:
* sun-java5-jdk
* kaffe
* java-gcj-compat
* j2sdk1.4
* fastjar
* sun-java6-jdk
Try: sudo apt-get install <selected package>
Make sure you have the 'multiverse' component enabled
bash: jar: command not found


I Googled for that and I'm not sure how to set the path to the jar command. (how can I tell where is the jar file lives?)

thanks for any pointers
adhg

Max Luebbe
August 19th, 2007, 04:39 AM
you dont have java installed.


sudo apt-get install sun-java6-jdk

then try again - if you're confused on how to use jar, consult its man page.

adhg
August 19th, 2007, 02:23 PM
GREAT! thanks Max, I downloaded the Java and the jar works.

I tried: jar xf /home/adhg/Desktop/Runway

and it worked.

I learned that the extracted folder is under home/adhg and not under my desktop (all files are scattered into this folder)

I tried variation of unzip...as in: unzip file.zip -d /home/adhg/Desktop/tmp

(on my side it was:
jar xf /home/adhg/Desktop/Runway -d /home/adhg/Desktop/tmp)

Although the prompt return with no errors....nothing happens! can you advise how to unzip (unjar) the folder into the desktop.

thank you so much!

slavik
August 20th, 2007, 12:44 AM
cd Desktop/somedir (somedir has to already exist)
jar xf ../file.war

adhg
August 20th, 2007, 04:19 AM
got ya!
thanks