Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot-generated uberjar zip file has corrupted content on Java 13 #752

Open
shaunr0b opened this issue Oct 10, 2019 · 1 comment
Open

Boot-generated uberjar zip file has corrupted content on Java 13 #752

shaunr0b opened this issue Oct 10, 2019 · 1 comment

Comments

@shaunr0b
Copy link

shaunr0b commented Oct 10, 2019

Describe the bug
The JAR file produced by boot build when used in the default way produces a zip containing a corrupt metadata file (META-INF/MANIFEST.MF)

To Reproduce
Steps to reproduce the behavior:

  1. Create a new boot project
boot -d boot/new new -t app -n myapp
cd myapp
boot run
  1. Run boot build to generate a jar

  2. Use unzip command to unzip the jar
    unzip target/myapp-0.1.0-SNAPSHOT-standalone.jar

Expected behavior
The jar file should unzip without error.

Actual
The JAR fails to unzip on this file:

    inflating: META-INF/MANIFEST.MF   bad CRC bd07333f  (should be 5fbe64cb)

Desktop (please complete the following information):

  • OS: Mac OS X 10.14.6
  • BOOT_VERSION=2.8.3
  • BOOT_CLOJURE_VERSION=1.10.1
  • BOOT_CLOJURE_NAME=org.clojure/clojure
  • JDK 13 build 33 (2019/8/9)

Additional context

  • The JAR does run without issue using java -jar target/my-app.jar
  • Ran into this issue when deploying an app to Elastic Beanstalk, which unzips the jar using the unzip command
  • Reproduced the issue locally with my own app, and then with a brand new app using the instructions above.
  • After downgrading to JDK 1.8, it works.
  • Have not tested the JDK versions in between 13 and 1.8 (11, 12)
@casphas
Copy link

casphas commented Jan 20, 2020

This is probably related to [https://bugs.openjdk.java.net/browse/JDK-8233457]: "Writing out data with ZipFileSystem leads to a CRC failure in the generated jar file".

I noticed the same problem with JDK 11 starting with 11.0.4. The OpenJDK bug states that this is also present in JDK 13. Reverting to JDK 11.0.3 or JDK 8 worked for me. The fix is in JDK 11.0.6 and JDK 14 if I read the OpenJDK ticket correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants