libgdx / packr

Packages your JAR, assets and a JVM for distribution on Windows, Linux and Mac OS X
Apache License 2.0
2.57k stars 171 forks source link

Packing with Oracle JDK causes error #227

Open mkikets99 opened 2 years ago

mkikets99 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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...