Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
9.0
-
JDK 9.0.4 and JDK 10 on Linux
NetBeans jenkins build
Description
I was doing a quick experiment with lwjgl (Lightweight Java Game Library) and Java modules an a recent jenkins build of netbeans 9.0.
The screenshot shows the error condition.
The reproducer is to:
- Create a new Java Modular Project with a JDK9 or JDK10 platform.
- Create a new module
- In the module add the lwjgl-3.1.6.jar downloaded from [http://search.maven.org/remotecontent?filepath=org/lwjgl/lwjgl/3.1.6/lwjgl-3.1.6.jar|maven].
At this point netbeans shows the project as valid but the project fails to build. Updating the modules-info.java from 'requires lwjgl;' causes netbeans to show an invalid project but the project now builds correctly.
With a maven project the projects is also shown as invalid.
Digging through the code it looks like the getModuleName(URL,boolean) method in java.source.base/src/org/netbeans/modules/java/source/ModuleNames.java needs to be updated to support the Multi-release JAR files section from the [https://docs.oracle.com/javase/9/docs/specs/jar/jar.html#multi-release-jar-files|JAR File Spec].
Probable change in Binary logic is to first look for Multi-Release attribute in the MANIFEST.MF. If true, starting with current source version (not currently supplied to the method), work backwards in source versions looking for a module-info.class in the versions directories, use it's module name if found. Otherwise (or false) use the current logic, root module-info module name, Automatic-Module-Name, or compute an automatic module name.
Attachments
Attachments
Issue Links
- links to