Skip to content

Detect Java version requirements of Fabric mods - #196

Merged
pavog merged 1 commit into
masterfrom
fabric-java-version-dependency
Nov 13, 2026
Merged

pavog merged 1 commit into
masterfrom
fabric-java-version-dependency

Conversation

@pavog

@pavog pavog commented Nov 13, 2026

Copy link
Copy Markdown
Member
- Mod 'Foo' (foo) 1.0.0 requires version 99 or later of 'Java HotSpot(TM) 64-Bit Server VM' (java), but only the wrong version is present: 25!

Fabric Loader provides Java as a built-in mod with the id java, named after the running JVM (java.vm.name).
When a mod needs a newer Java, the loader reports it like a missing mod dependency.
FabricModDependencyProblem matched that line and reported "The mod 'Foo' is missing the required mod 'Java HotSpot(TM) 64-Bit Server VM'." with the solution "Install the mod 'Java HotSpot(TM) 64-Bit Server VM' with version >=99.", which is wrong on both counts.

This PR adds FabricModJavaVersionProblem, which names the mod and the required Java version and suggests the existing UpdateJavaSolution.
FabricModDependencyProblem skips dependencies with the id java, so the line is not reported twice.

The pattern anchors on the id (java) and not on the name, because the name depends on the JVM vendor (OpenJDK 64-Bit Server VM, Java HotSpot(TM) 64-Bit Server VM, ...).
An exact requirement ("java": "99", logged as requires version 99 of) is reported the same way, because in practice it means the installed Java is too old.

Changes

  • add FabricModJavaVersionProblem with the patterns minimum and specific
  • add the translation mod-java-version-problem
  • skip the Java dependency in FabricModDependencyProblem
  • add the fixtures fabric-java-version-dependency.log and fabric-java-version-dependency-exact.log, real Fabric Loader 0.20.1 server logs for Minecraft 26.3

Not covered: any version before, after and between requirements on Java, which are rare and have no meaningful update solution.

@pavog
pavog requested a review from JulianVennen November 13, 2026 19:38
@pavog
pavog merged commit 860ef14 into master Nov 13, 2026
3 checks passed
@pavog
pavog deleted the fabric-java-version-dependency branch November 13, 2026 19:48
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