Behavior change in the jar tool JDK11 vs JDK8.
Alan Bateman
Alan.Bateman at oracle.com
Mon Mar 14 17:21:41 UTC 2022
On 14/03/2022 11:48, Pasam Soujanya1 wrote:
> There is a significant difference in the way the JAR tool (starting JDK11) seems to be responding to target files that are not present , when compared to JDK8. With JDK 8, the jar tool just reports about target files that are absent, and creates the jar file with whatever targets are available.
>
> With JDK8, If I try to create a jar file with one existing file and another invalid file name I can see achieve getting created with the file that exists. Only the warning seems to be printed for the target that doesn't exists:
Can you check the exit code (echo $?)? There was a bug in JDK 8/older
releases with it leaving the temporary file behind when exiting with an
error, I suspect this is what you are seeing. This changed in JDK 9 to
cleanup when exiting with an error.
-Alan.
More information about the core-libs-dev
mailing list