2

I wish to store a few folders in a zip file and then convert that zip file into a jar.

I have the following folders : META-INF and org.

I tried the following command:

zip META-INF/ org/ wordcount.zip

But wordcount.zip was not created.

marked as duplicate by αғsнιη, David Foerster, Arronical, Aaron, Kevin Bowen Sep 26 '16 at 20:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Have you considered using the jar tool if you aim to create a Java Archive? – David Foerster Sep 26 '16 at 8:57
7

The syntax is the other way around; you give the name of the .zip file to create first in the list. Also, use the -r flag for recursion into directories:

zip -r wordcount.zip META-INF org

This creates a file wordcount.zip (you may be able to omit the .zip in the command as this is automatically added if possible) with all the contents of the two directories META-INF and org

Not the answer you're looking for? Browse other questions tagged or ask your own question.