Behavior change in the jar tool JDK11 vs JDK8.
Pasam Soujanya1
psoujany at in.ibm.com
Tue Mar 15 13:23:18 UTC 2022
Yes, jar command fails(exit code is 1) from JDK11 onward when target files do not exist while archiving the data.
Please find the below jar execution with JDK11
$ jar -cvf sample.jar nofile.txt
nofile.txt : no such file or directory
added manifest
$ echo $?
1
Could you please share any documentation if exists, with this behavior change. We couldn't find it in the release notes of 9,10,11.
Thanks,
Pasam Soujanya.
________________________________
From: Alan Bateman <Alan.Bateman at oracle.com>
Sent: Tuesday, March 15, 2022 5:39 PM
To: Pasam Soujanya1 <psoujany at in.ibm.com>
Cc: core-libs-dev at openjdk.java.net <core-libs-dev at openjdk.java.net>
Subject: [EXTERNAL] Re: Behavior change in the jar tool JDK11 vs JDK8.
On 15/03/2022 11:33, Pasam Soujanya1 wrote: Basically, we have a customer who use the jar command to zip up data files generated in a directory, most of the time the files don't exist. ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
On 15/03/2022 11:33, Pasam Soujanya1 wrote:
Basically, we have a customer who use the jar command to zip up data files generated in a directory, most of the time the files don't exist.
Can you confirm that the jar command is failing, meaning the exit code is non-0? The change in JDK 9 to remove the temporay file when jar fails was deliberate. Yes, it probably should have had a release note at the time.
-Alan
More information about the core-libs-dev
mailing list