Environment
- OS: CachyOS Linux (Arch-based)
- Java: Temurin 21.0.11 / 21.0.12 (both crash), GraalVM 21.0.2 (crash)
- NeoForge: 21.1.133 (reproduced with official MDK)
- ModLauncher: 11.0.4
- moddev: 2.0.141
- Gradle: 8.11.1
Description
Running runServer on NeoForge 1.21.1 MDK crashes on Linux with:
Exception in thread "main" java.lang.module.ResolutionException:
Module fml_loader reads more than one module named fml_earlydisplay
at MC-BOOTSTRAP/cpw.mods.modlauncher@11.0.4/cpw.mods.modlauncher.ModuleLayerHandler.buildLayer(ModuleLayerHandler.java:75)
Root Cause
The development environment puts earlydisplay-4.0.38.jar and loader-4.0.38.jar in both:
-cp (classpath)
-DlegacyClassPath.file (legacyClasspath)
ModuleLayerHandler.buildLayer collects jars from both sources without deduplication, causing JPMS to detect duplicate modules.
Trigger Condition
Only occurs when ~/.gradle/caches/modules-2/files-2.1 is a symlink to an NTFS partition (e.g., dual-boot setup sharing Gradle cache with Windows). When the symlink is removed and cache lives on btrfs directly, the issue disappears.
Platform Comparison
| Environment |
Gradle cache |
Result |
| Windows 11 |
On NTFS (native) |
✅ Works |
| Linux |
On NTFS (via symlink) |
❌ Crashes |
| Linux |
On btrfs (no symlink) |
✅ Works |
| Linux |
Production (Prism Launcher) |
✅ Works |
Reproduction
- Clone the official MDK:
git clone https://github.com/NeoForgeMDKs/MDK-1.21.1-ModDevGradle.git
- Symlink
~/.gradle/caches/modules-2/files-2.1 to an NTFS partition
- Run
./gradlew runServer --no-daemon
- Observe
ResolutionException
Impact
- Linux users with dual-boot setups who share Gradle cache with Windows
- Development environment only; production (Prism Launcher, server jar) works fine
- NeoForge 26.1.2 (mc2612) is NOT affected (uses different loader - FancyModLoader)
Suggested Fix
In ModuleLayerHandler.buildLayer(), deduplicate the targets list:
List<String> targets = Arrays.stream(finder)
.map(SecureJar::name)
.distinct()
.toList();
Or, in the moddev Gradle plugin, avoid putting the same jars in both -cp and legacyClasspath.
Environment
Description
Running
runServeron NeoForge 1.21.1 MDK crashes on Linux with:Root Cause
The development environment puts
earlydisplay-4.0.38.jarandloader-4.0.38.jarin both:-cp(classpath)-DlegacyClassPath.file(legacyClasspath)ModuleLayerHandler.buildLayercollects jars from both sources without deduplication, causing JPMS to detect duplicate modules.Trigger Condition
Only occurs when
~/.gradle/caches/modules-2/files-2.1is a symlink to an NTFS partition (e.g., dual-boot setup sharing Gradle cache with Windows). When the symlink is removed and cache lives on btrfs directly, the issue disappears.Platform Comparison
Reproduction
git clone https://github.com/NeoForgeMDKs/MDK-1.21.1-ModDevGradle.git~/.gradle/caches/modules-2/files-2.1to an NTFS partition./gradlew runServer --no-daemonResolutionExceptionImpact
Suggested Fix
In
ModuleLayerHandler.buildLayer(), deduplicate thetargetslist:Or, in the moddev Gradle plugin, avoid putting the same jars in both
-cpandlegacyClasspath.