Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4362830

jar -C option does not work as advertised/documentation needs to be updated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 1.3.0
    • tools
    • jar
    • sparc
    • solaris_7

      Name: skT45625 Date: 08/15/2000


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, green threads, sunwjit)


      cd /var/tmp
      mkdir -p a/b/c
      cd a/b/c
      touch foo.txt1
      touch foo.txt2
      cd ../../..
      jar cvf stuff.jar -C /var/tmp a/b/c/foo.txt1 -C /var/tmp/a b/c/foo.txt2

      Shouldn't that result in a jarfile whose tf output is like this:

      META-INF/
      META-INF/MANIFEST.MF
      a/b/c/foo.txt1
      b/c/foo.txt2

      ...? Instead, this results in a jarfile whose tf output is like this:

      META-INF/
      META-INF/MANIFEST.MF
      a/b/c/foo.txt1
      a/b/c/foo.txt2

      ...i.e. somehow jar seems to know that really those files are in the same
      place? But some -C options work fine. If I -C to another directory entirely:

      jar cf stuff.jar -C /var/tmp a/b/c/foo.txt1 -C /var/tmp/a b/c/foo.txt2 -C
      /somewhere/else yahoo.txt

      ...I get a mix:

      META-INF/
      META-INF/MANIFEST.MF
      a/b/c/foo.txt1
      a/b/c/foo.txt2
      yahoo.txt

      What's going on? I was under the impression, as jar's usage message states,
      that I could freely use many -C options and that jar would respect the degree of
      relativity I specify.
      (Review ID: 108469)
      ======================================================================

            Unassigned Unassigned
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: