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

Detect UnsupportedClassVersionErrors in newer versions of Paper #78

Merged
merged 3 commits into from
Jul 4, 2024
Merged

Detect UnsupportedClassVersionErrors in newer versions of Paper #78

merged 3 commits into from
Jul 4, 2024

Conversation

pavog
Copy link
Member

@pavog pavog commented Jul 4, 2024

In older versions of Paper the message is:

Could not load 'plugins/Slimefun4-1027.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: io/github/thebusybiscuit/slimefun4/implementation/Slimefun has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0

In newer versions of Paper the message is:

Could not load plugin 'worldedit-bukkit-7.3.4-beta-01.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/sk89q/worldedit/bukkit/WorldEditPlugin has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

This PR adds a regex pattern to also detect the new message.
This PR also changes the old regex pattern so that both patterns return the same matches and the function setMatches can process matches for both patterns in the same way.
In this case these are:

  • File name of the plugin (e.g. worldedit-bukkit-7.3.4-beta-01.jar)
  • Name of the plugin (e.g. worldedit-bukkit-7.3.4-beta-01)
  • Name of the folder (e.g. plugins)
  • Class file version (e.g. 65)

@matthi4s matthi4s merged commit 09e6ac3 into aternosorg:master Jul 4, 2024
3 checks passed
@pavog pavog deleted the paper-unsupported-class-version branch July 4, 2024 11:11
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