You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[7.0] Package org.lwjgl:lwjgl-glfw is not exposed to compile-time on 1.18.2 #30
Code that uses GLFW (for example) won't compile. (Yes, I know that Mojang advises against it)
Quick and dirty compileOnly with org.lwjgl:lwjgl-glfw:3.2.2 fixes the issue. 1.19.2 (and also more new versions like 1.20.1, 1.21.1, 1.21.11, 26.1.2) are not affected.
I'm unsure if this is the right place to report or this is a userdev issue, I don't know about Forge's internals.
Gradle: 9.5.0
Forge: 1.18.2-40.3.12 (latest 1.18.2 at the time of writing)
ForgeGradle: 7.0.25
renamer (unneeded in fact for the sample code): 1.1.0
Okay, I think I understand the issue.
For the compile classpath java selects the api-classes variant
Specifically because it wants org.gradle.usage = java-api
We only publish one variant of api-classes with libraries that do not have an OS requirement.
Now, why is that an issue on 1.18.2 and not on 1.20.1
Well if you take a look at 1.18.2 their root glfw is different depending on the OS:
3.2.1 on osx, and 3.2.2 on everything else.
So, the 'fix' is to publish OS specific variants and make sure that the dependency requests the OS specific variants.
When i get some free time i'll look into implementing it unless Jonathing wants to poke it first.
Main thing is I need to make sure that the compileClasspath has the OS attribute set on the gradle side.
And then rework this function to know what is a native file and what is an actual library.
Activity
LexManos commentedon May 1, 2026
Okay, I think I understand the issue.
For the compile classpath java selects the
api-classesvariantSpecifically because it wants
org.gradle.usage=java-apiWe only publish one variant of
api-classeswith libraries that do not have an OS requirement.Now, why is that an issue on 1.18.2 and not on 1.20.1
Well if you take a look at 1.18.2 their root glfw is different depending on the OS:
3.2.1 on osx, and 3.2.2 on everything else.
{ "downloads": { "artifact": { "path": "org/lwjgl/lwjgl-glfw/3.2.1/lwjgl-glfw-3.2.1.jar", "sha1": "027abb7f64894b61cad163791acd8113f0b21296", "size": 116708, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl-glfw/3.2.1/lwjgl-glfw-3.2.1.jar" } }, "name": "org.lwjgl:lwjgl-glfw:3.2.1", "rules": [ { "action": "allow", "os": { "name": "osx" } } ] }, { "downloads": { "artifact": { "path": "org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar", "sha1": "d3ad4df38e400b8afba1de63f84338809399df5b", "size": 108907, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl-glfw/3.2.2/lwjgl-glfw-3.2.2.jar" } }, "name": "org.lwjgl:lwjgl-glfw:3.2.2", "rules": [ { "action": "allow" }, { "action": "disallow", "os": { "name": "osx" } } ] },Whereas 1.20.1 uses the same glfw version for all OSes, just with the natives different by os.
{ "downloads": { "artifact": { "path": "org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar", "sha1": "cbac1b8d30cb4795149c1ef540f912671a8616d0", "size": 128801, "url": "https://libraries.minecraft.net/org/lwjgl/lwjgl-glfw/3.3.1/lwjgl-glfw-3.3.1.jar" } }, "name": "org.lwjgl:lwjgl-glfw:3.3.1" },So, the 'fix' is to publish OS specific variants and make sure that the dependency requests the OS specific variants.
When i get some free time i'll look into implementing it unless Jonathing wants to poke it first.
Main thing is I need to make sure that the compileClasspath has the OS attribute set on the gradle side.
And then rework this function to know what is a native file and what is an actual library.