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

UnsupportedClassVersionError #85

Open
haraleib opened this issue Jun 4, 2024 · 3 comments
Open

UnsupportedClassVersionError #85

haraleib opened this issue Jun 4, 2024 · 3 comments
Assignees

Comments

@haraleib
Copy link

haraleib commented Jun 4, 2024

Hello, I am trying to update from to Jasper Reports 6.11.0 to 6.21.2 so it seems to be a good choice to also update jasperreports-plugin. So I am now taking it from your repo with Version 3.6.1.

I am getting the following exception when i build my project.

com.pro-crafting.tools:jasperreports-plugin:3.6.1:jasper (default) on project XXXX: Error while compiling Jasper reports: java.lang.UnsupportedClassVersionError: net/sf/dynamicreports/jasper/base/JasperSystemFontExtensionsRegistryFactory has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Any idea how can i get fix this?
My plugin configuration looks like the following
image

@Postremus
Copy link
Contributor

sorry for not getting back to you earlier.

It looks to me like net/sf/dynamicreports was compiled using java 17 without the --release 11 switch set.
I never used dynamicreports however, and according to their website they seem to be still compatible with java 8 - which would also include java 11 compatibility.

Out of curiosity, how did you solve this in the end? Might be helpful for others with the same error.

@haraleib
Copy link
Author

Thanks for your answer. I searched a little bit on the internet, where did you find the possibility to set a --release flag for dynamicreports. I have the impression, that it lacks a little bit for documentation, so I didnt found something according this. Maybe you can post a link or something like this :)

@Postremus
Copy link
Contributor

With the --release 11 flag I meant the jdk compiler flag. https://openjdk.org/jeps/247

I was previously just looking at the dynamicreports website https://dynamicreports.org/, which did not point to any update of this library past 2018, and did not hint at maven coordinates. I assumed the library had to be therefore compiled manually, which lead me to believe that you might have used jdk 17 by mistake for the compilation. Sorry for this misunderstanding.

I dug a bit deeper and found their new github https://github.com/dynamicreports/dynamicreports.
They updated to java 17 (from 1.8) with dynamicreports 6.20.1 in PR dynamicreports/dynamicreports#132.

According to dynamicreports/dynamicreports#124 (comment) you might be able to use dynamicreports 6.20.0, which could be compatible with java 11. Can you please try this out? Not sure though if it is compatible with jasper 6.21.2.

@Postremus Postremus reopened this Jun 17, 2024
@Postremus Postremus self-assigned this Jun 17, 2024
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