packr icon indicating copy to clipboard operation
packr copied to clipboard

Packing with Oracle JDK causes error

Open mkikets99 opened this issue 3 years ago • 2 comments

when building with official Oracle JDK archives There is an error

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
java.nio.file.NoSuchFileException: dist/linux64/tmp/jdk-17.0.4/LICENSE
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
        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.createSymbolicLink(UnixFileSystemProvider.java:471)
        at java.base/java.nio.file.Files.createSymbolicLink(Files.java:1069)
        at com.badlogicgames.packr.ArchiveUtils.extractTarArchive(ArchiveUtils.java:196)
        at com.badlogicgames.packr.ArchiveUtils.extractArchive(ArchiveUtils.java:127)
        at com.badlogicgames.packr.Packr.copyAndMinimizeJRE(Packr.java:406)
        at com.badlogicgames.packr.Packr.pack(Packr.java:175)
        at com.badlogicgames.packr.Packr.main(Packr.java:75)

It is because Oracle using a symbolic link on LICENSE file and in archive it seems like an empty file, but it is actually linked to legal/java.base/LICENSE. When it is unpacked, it is working good.

mkikets99 avatar Aug 17 '22 09:08 mkikets99

If you interested: Packr working perfectly even with Java 17

java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

It just this issue that a link file in the archive seems like it is an empty file...

mkikets99 avatar Aug 17 '22 11:08 mkikets99

Ok... Final verdict of what causing this: When it is trying to make a copy from tar or zip, it see a file and cannot open it for copy, because it see it as empty file...

mkikets99 avatar Aug 17 '22 13:08 mkikets99