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
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
- relates to
-
JDK-6323339 Given -u and non existing file, jar now updates manifest and returns 0
-
- Closed
-
-
JDK-6959600 jar can extract and overwrite the wrong file
-
- Closed
-