Results 1 to 8 of 8

Thread: how to unzip/untar war files

  1. #1
    Join Date
    Aug 2007
    Beans
    81

    how to unzip/untar war files

    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?

  2. #2
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: how to unzip/untar war files

    Code:
    jar xf prj.war
    this might work (not tested)

    Code:
    tar zxf prj.war
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  3. #3
    Join Date
    Aug 2006
    Location
    Germany, Bonn
    Beans
    59
    Distro
    Xubuntu 7.04 Feisty Fawn

    Re: how to unzip/untar war files

    I suggest you try these commands as well.

    Code:
    man unzip
    Code:
    man tar

  4. #4
    Join Date
    Aug 2007
    Beans
    81

    Re: how to unzip/untar war files

    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

  5. #5
    Join Date
    Jun 2006
    Location
    Chicago, IL, USA
    Beans
    129
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: how to unzip/untar war files

    you dont have java installed.

    Code:
    sudo apt-get install sun-java6-jdk
    then try again - if you're confused on how to use jar, consult its man page.

  6. #6
    Join Date
    Aug 2007
    Beans
    81

    Re: how to unzip/untar war files

    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!

  7. #7
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: how to unzip/untar war files

    cd Desktop/somedir (somedir has to already exist)
    jar xf ../file.war
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  8. #8
    Join Date
    Aug 2007
    Beans
    81

    Re: how to unzip/untar war files

    got ya!
    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •