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

"jar xf" exits with status 0 even if requested file isn't in jar file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 6u18
    • tools
    • None
    • jar
    • x86
    • solaris_nevada

      If I try to extract a file that isn't in the jar file, jar(1) fails
      silently: no error message, and the exit status is zero.

      athyra$ jar cf foo.jar foo.pl
      athyra$ jar xf foo.jar no-such-file
      athyra$ echo $?
      0

      Contrast that with the tar command, which complains and exits with a
      non-zero status:

      athyra$ tar cf foo.tar foo.pl
      athyra$ tar xf foo.tar no-such-file
      tar: 1 file(s) not extracted
      athyra$ echo $?
      1

            sherman Xueming Shen
            mkupfer Mike Kupfer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: