Robert Fitzsimons created NETBEANS-602: ------------------------------------------
Summary: Wrong module name detected with multi-release JAR Key: NETBEANS-602 URL: https://issues.apache.org/jira/browse/NETBEANS-602 Project: NetBeans Issue Type: Bug Components: java - Source Affects Versions: 9.0 Environment: JDK 9.0.4 and JDK 10 on Linux NetBeans jenkins build Reporter: Robert Fitzsimons Attachments: multirel.png 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. !multirel.png! 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. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists