KosmosPrime / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
34 stars 15 forks source link

Fix crash on Java 11 #2

Closed embeddedt closed 1 year ago

embeddedt commented 1 year ago

The SystemUtils.isJavaVersionAtLeast method provided by Apache Commons crashes on newer versions of Java (refer to https://issues.apache.org/jira/browse/LANG-1384). Presumably Mojang does not ship a version of Commons with the upstream fix included. It does work on Java 8 but I prefer to use Java 11 when possible.

As the only usage of it here is to detect Java 7 or later, and we know Minecraft requires Java 8, the check can be removed entirely.

asiekierka commented 1 year ago

Thank you! This patch can also be provided for Minecraft 1.12.2 upstream, if you'd prefer, as that version will also work only on Java 8.

KosmosPrime commented 1 year ago

I've not really tested the port for Java >8, thanks for finding this (and for the reminder to check). I'm pulling this because I feel it's more likely someone would run into this in MC 1.16 than 1.12, but please do feel free to backport the fix.