netbeans-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emma Atkinson <>
Subject Netbeans ant build script not finding Log4j2 V2.11.1 module-info.class
Date Wed, 03 Oct 2018 09:55:45 GMT
I cannot find a way to make this work, I hope you can help.  I should be
happy to be pointed to an existing answer

*The Problem*
I have a very simple Java application demonstrating the problem I am having
with using the latest Log4j2 V2.11.1 as a module (log4j.api) and building
it in Netbeans.  The example compiles, builds and runs when I use the
classpath, but cannot compile the file when I use the
modulepath. I have uploaded the code and Netbeans files at the following

Log4j2 V2.11.1 is a Multi-release JAR (MR-JAR).  The module-info.class file
is in log4j-api-2.11.1.jar under the folder META-INF/versions/9, which
seems correct.

The Netbeans editor can see the module log4j.api because it appears in the
drop-down menu of completion suggestions and does not have wiggly red line
under it.  My simple test program has a file that requires
log4j.api and nothing else.  This bit works as I would expect.

I have located an unanswered question on StackOverflow asking a similar

*To Reproduce My Test *

I *Clean* the project.  It completes successfully.
I then use a RMB option to *Compile File* the file.
This generates an error pointing to the line *requires log4j.api* in my

<path-to>/Log4j2TestCase/src/ error: module not found:
    requires log4j.api;
1 error
ZipFileIndex clearCache failed
<path-to>/Log4j2TestCase/nbproject/build-impl.xml:1131: The following error
occurred while executing this line:
<path-to>/Log4j2TestCase/nbproject/build-impl.xml:358: Compile failed; see
the compiler error output for details.

and so on.  Please let me know if you want more.

I have tried building this program under JDK-9, JDK-10 and JDK-11.  My
Netbeans runs on JDK-10.  I am learning how to migrate to modules by trial,
error and reading.  I may have made an error, but if I have, I don't know

Thanks in anticipation


View raw message