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

Fat/uber Jar doesn't work because of the multi-release feature #60

Open
romanzes opened this issue Sep 1, 2023 · 2 comments
Open

Fat/uber Jar doesn't work because of the multi-release feature #60

romanzes opened this issue Sep 1, 2023 · 2 comments

Comments

@romanzes
Copy link

romanzes commented Sep 1, 2023

I'm trying to build a jar file for my Java program that depends on Skija with the help of the Gradle Shadow plugin. It builds fine, however, I can't run it, because it complains that sun.misc.Cleaner, referenced in Cleanable.java, doesn't exist. I can see that there are 2 versions of Cleanable.java, pre- and post-Java 9, and it looks like the pre-java-9 version ends up being used even though my JDK is newer.

What's the best strategy to create a working Jar file then? I'd be fine with one that doesn't work on Java versions before 9.

@tonsky
Copy link
Contributor

tonsky commented Sep 5, 2023

Funny how I have two mirror issues one after another: #61 complains that Java 8 doesn’t work :)

Can you try it with plain javac and java? Works for me. If it works for you, then problem is in Gradle

Screenshot 2023-09-05 at 16 05 03

@Glavo
Copy link
Contributor

Glavo commented Sep 14, 2023

You just need to add Multi-Release: true in MANIFEST.MF.

I think it's a issue with shadow jar, see GradleUp/shadow#449.

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

No branches or pull requests

3 participants