works, because the shell turns *.class into a.class b.class c.class, which is what the jar program sees.
jar cf foo.jar *.class
thinking that I'd get /tmp's a, b, and c.class files. However, the shell expands that to
jar -cf foo.jar -C /tmp *.class
In short, you can't use the asterisk with the -C option (unless you happen to have files with the same names in your current directory).
jar -cf foo.jar -C /tmp x.class y.class
user485422 wrote:Yeah, but that defeats the purpose of the -C. You use -C so that you can give relative paths, and they will appear as such in the jar.
Hello. Thanks for your answer.
A friend of mine used this:
D:\Java\j2sdk1.4.2_09\bin\jar cf OfflineDocs.jar -C \Web\Tomcat\webapps\toplife\applets\help \Web\Tomcat\webapps\toplife\applets\help\avb_d\WebHelp\*.pdf
and it works!
The only difference I see is the path (in my case with a space and "").
user485422 wrote:That's rather surprising. It tried something like that earlier and I didn't get those results. I'll try to do some more messing around later and see what I come up with. It might have to do with a Windows vs. Linux vs. Cygwin difference in how that * is expanded.
The structure in the jar is: