Skip to content

Fix library class version error #1118

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ThexXTURBOXx
Copy link

I depended on a library compiled for Java 21 and stumbled upon this error.
I was quite puzzled by the error message - however after some testing I was able to confirm that Java 17 libraries work fine whilst Java 18 libraries (and later) do not.
This PR fixes the confusing error message.

Copy link

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to see if you can use something like https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runtime.Version.html in order to avoid the need to keep this info string up to date.

@ThexXTURBOXx
Copy link
Author

Done - that's actually a pretty good idea. At first, I thought about System.getProperty("java.version"), but Runtime#version is way cleaner, I think.

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

Successfully merging this pull request may close these issues.

2 participants