Hello,
First, thank you for the amazing job !
I've got some troubles using LWJGL with Java 9 modules on eclipse.
Eclipse seems to understand that:
requires lwjgl;
requires lwjgl.glfw;
requires lwjgl.vulkan;
requires lwjgl.assimp;
requires lwjgl.openal;
requires lwjgl.stb;
But the naming seems bad. On the other hand, building with gradle only works with:
requires org.lwjgl;
requires org.lwjgl.glfw;
requires org.lwjgl.vulkan;
requires org.lwjgl.assimp;
requires org.lwjgl.openal;
requires org.lwjgl.stb;
I'm not sure what I'm doing wrong, do you have any idea?
My build.gradle : https://pastebin.com/uQGGVTyq
The generated .project in eclipse : https://pastebin.com/tuYa71p0
Modules names start with org.lwjgl. Does this comment help?
Not really :'(
It seems that the module-info.java of lwjgl jars are not read, and I just saw that Eclipse doesn't support multi release jars for now (https://bugs.eclipse.org/bugs/show_bug.cgi?id=509985). Maybe the problem is here?
Yes, that's the problem I guess. The module-info.class files are under META-INF/versions/9/ inside the JAR files. This is the recommended way to deploy modular JARs that may also run on Java versions lower than 9. Putting module-info.class at the JAR root was causing too many issues with various tools/build systems that are not up-to-date with the Java Module System.
You can probably work around this by putting LWJGL in --class-path instead of --module-path.
I think I can't do that, because I need to use modules, and (at least in Eclipse?) modules doesn't see the jars defined in classpath.
Unless you need to use jlink, there shouldn't be a problem with mixing modules and classpath libraries.
I don't know about Eclipse, have only used it once many years ago. But it does seem from reported issues so far that their Java 9 support is lacking.
Another suggestion (assuming switching to another IDE is out of the question): set up everything without modules in Eclipse, but do modular builds using Maven or Gradle.
New specific issue for this point:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=534624
Another work around option: Opening the JARs as zip archives (using 7-Zip) and copying the module-info.class from the versions folder to the root of the JARs makes them recognized by Eclipse. This doesn't seem to work for the natives, so keep those on the classpath. It is tedious but it works.
Side note: I wonder if multi-release JAR support is lacking because IBM (main Eclipse IDE contributor) is still salty about the Java 9 module system.
The issue is corrected (cf the bugzilla).
I tested with the very last JDT nightly build: the lwjgl module-info.class is correctly read.
Eclipse 2018-09_M3 will have the fix.
Most helpful comment
The issue is corrected (cf the bugzilla).
I tested with the very last JDT nightly build: the lwjgl module-info.class is correctly read.
Eclipse 2018-09_M3 will have the fix.