When the "jar --validate" command is run as follows:
cat $JAVA_HOME/lib/jrt-fs.jar | jar --validate
then it leads to the following exception:
java.nio.file.FileAlreadyExistsException: /tmp/tmpJar128144111130442323.jar
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:262)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482)
at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
at java.base/java.nio.file.Files.copy(Files.java:3164)
at jdk.jartool/sun.tools.jar.Main.run(Main.java:430)
at jdk.jartool/sun.tools.jar.Main.main(Main.java:1708)
This is due to an oversight in the implementation of the validate option, where "Files.copy(in, file.toPath())" is called on an already existing (just generated temporary) target file.
cat $JAVA_HOME/lib/jrt-fs.jar | jar --validate
then it leads to the following exception:
java.nio.file.FileAlreadyExistsException: /tmp/tmpJar128144111130442323.jar
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:94)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:262)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482)
at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
at java.base/java.nio.file.Files.copy(Files.java:3164)
at jdk.jartool/sun.tools.jar.Main.run(Main.java:430)
at jdk.jartool/sun.tools.jar.Main.main(Main.java:1708)
This is due to an oversight in the implementation of the validate option, where "Files.copy(in, file.toPath())" is called on an already existing (just generated temporary) target file.
- relates to
-
JDK-8316804 Gracefully handle the case where --release is not specified last
-
- Open
-
- links to
-
Commit(master) openjdk/jdk/725079bf
-
Review(master) openjdk/jdk/22734