Re: Is there really no wildcard adding for "jar -cvf my.jar classes\*.class" ?



In article <48162a7a$0$7540$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
gremlin@xxxxxxxxxxx (Catherina Svensson) wrote:

When I try to execute a jar command like the following:
jar -cvf my.jar classes\*.class
then JVM gives me an error about non-existing files/folders.

However when I specify all the class files in detail:
jar -cvf my.jar classes\a.class classes\b.class ... classes\z.class
then everything is fine.
[...]

Assuming you want to preserve the existing directory structure:

$ ls *
MANIFEST.MF clip.class clip.java clip.jpg
classes:
one.class two.class

$ jar cvmf MANIFEST.MF temp.jar *.class classes/*.class
added manifest
adding: clip.class(in = 2241) (out= 1203)(deflated 46%)
adding: classes/one.class(in = 2241) (out= 1203)(deflated 46%)
adding: classes/two.class(in = 2241) (out= 1203)(deflated 46%)

The interpretation of wildcards is done by your shell before invoking
jar, which should only see the expanded list of names in your second
example. What shell are you using?

John
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
.



Relevant Pages