Module-info in nd4j-api-1.0.0-M2.1.jar exports inexistent package org.nd4j.autodiff.validation.listeners

Author: slava888Created Jun 25, 2025Updated Jul 5, 2025

Trying to use deeplearning4j in my project I am confronted with error:

> Task :ssv9:gui:SSVMainWindow.main() FAILED Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: C:\g\caches\modules-2\files-2.1\org.nd4j\nd4j-api\1.0.0-M2.1\4b64944e3f662a0ec69fd5a30cfc736f76a8005\nd4j-api-1.0.0-M2.1.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Package org.nd4j.autodiff.validation.listeners not found in module

If you check the https://repo1.maven.org/maven2/org/nd4j/nd4j-api/1.0.0-M2.1/nd4j-api-1.0.0-M2.1.jar there is actually META-INF\versions\9\module-info.class which is picked by Java module system. The file contains entry:

open module nd4j.api { ... exports org.nd4j.autodiff.validation.listeners;

There is no such package in the jar.

Due to module-info being actually present in the jar, it is cumbersome to override with https://github.com/gradlex-org/extra-java-module-info plugin:

`> Could not resolve all files for configuration ':common:javafx-gui:csv-import:compileClasspath'.

Failed to transform nd4j-api-1.0.0-M2.1.jar (org.nd4j:nd4j-api:1.0.0-M2.1) to match attributes {artifactType=jar, javaModule=true, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}. > Execution failed for ExtraJavaModuleInfoTransform: C:\g\caches\modules-2\files-2.1\org.nd4j\nd4j-api\1.0.0-M2.1\4b64944e3f662a0ec69fd5a30cfc736f76a8005\nd4j-api-1.0.0-M2.1.jar. > Patching of real modules must be explicitly enabled with 'patchRealModule()' and can only be done with 'module()'`

Source: deeplearning4j/deeplearning4j