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



Knute Johnson wrote:
Mark Space wrote:
Catherina Svensson wrote:
When I try to execute a jar command like the following:

jar -cvf my.jar classes\*.class

I think it's just:

jar -cvf my.jar classes

That will include all the files in the classes directory, not just .class files. That isn't her problem anyway, she's got a package mismatch between the declarations and the jar structure, and that's why it won't run.


Normally that's what I want -- I'll need to package up any resource files too. And classes in a package normally are stored in subdirectories by the compiler -- *.classes won't get those, but my command line will.

I see your point about my answer being different from the op's point however. If someone actually does need to filter .class files out of a directory, then I think their build process is broken. Get the extraneous stuff out of the classes subdir, put it some where else.
.



Relevant Pages

  • Re: Is there really no wildcard adding for "jar -cvf my.jar classes*.class" ?
    ... jar -cvf my.jar classes\*.class ... That will include all the files in the classes directory, not just ..class files. ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.help)
  • Re: Performance issue: jar vs. bin/classes
    ... appications packed into jar files and java applications which are ... jars are more compact for transmission. ... Class files don't need to be ... With a jar you know exactly what classes are being ...
    (comp.lang.java.programmer)
  • Re: Big JARs = Big Problems?
    ... meaning they have a lot of .class files. ... even one comma in one class changes you have to send the whole jar. ... make sure they are on the classpath. ...
    (comp.lang.java.programmer)
  • Re: Accessing .class files in a Jar
    ... they won't have sufficient rights to put a file in the ext folder. ... But I tried simply jarring up the class files, ... provided you build your jar correctly. ... the filesystem within the jar matches the package structure of the class files. ...
    (comp.lang.java.help)
  • Re: Putting Packaged Classes Into A JAR File
    ... > the class files were if there was no package) DOES put the files into the ... > JAR complete with their directory hierarchy (viewing the JAR confirms this). ... From the OS/2 WARP v4.5 Desktop of Brad BARCLAY. ...
    (comp.lang.java.help)