Description: removing use of java.util.jar.Pack200, removed in OpenJDK 17 Author: Pierre Gruet Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011924 Forwarded: https://github.com/puniverse/capsule/pull/137 Last-Update: 2022-05-28 --- a/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java +++ b/capsule-util/src/main/java/co/paralleluniverse/capsule/Jar.java @@ -37,7 +37,7 @@ import java.util.jar.JarInputStream; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; -import java.util.jar.Pack200; +//import java.util.jar.Pack200; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import static java.nio.charset.StandardCharsets.UTF_8; @@ -56,7 +56,7 @@ private final Manifest manifest; private final JarInputStream jis; private JarOutputStream jos; - private Pack200.Packer packer; + //private Pack200.Packer packer; private String jarPrefixStr; private Path jarPrefixFile; private boolean sealed; @@ -567,10 +567,10 @@ * @param packer * @return {@code this} */ - public Jar setPacker(Pack200.Packer packer) { + /*public Jar setPacker(Pack200.Packer packer) { this.packer = packer; return this; - } + }*/ /** * If set to true true, a header will be added to the JAR file when written, that will make the JAR an executable file in POSIX environments. @@ -706,9 +706,9 @@ throw new IllegalStateException("Cannot write to another target if setOutputStream has been called"); final byte[] content = ((ByteArrayOutputStream) this.os).toByteArray(); - if (packer != null) + /*if (packer != null) packer.pack(new JarInputStream(new ByteArrayInputStream(content)), os); - else + else*/ os.write(content); os.close();