I thought at first Log4j 2.x wasn't an Java module, and it does not have an Automatic-Module-Name.
It appears that Log4j API is a Java Module with an module-info.class.
Even though log4j-api.jar is on the project modulepath in eclipse, Eclipse cannot find that module.
The module-info.class is not in the placed at the package root, but at META-INF/versions/9/
Because of this Eclipse cannot find out that Log4j is a Java Module.
Is this a known problem with Eclipse?
Eclipse Java EE IDE for Web Developers.
Version: Oxygen.3a Release (4.7.3a)
Build id: 20180405-1200
Building with gradle works fine. Gradle finds the log4j module.
I had to write the logging code without the support of Eclipse IDE and that was a real pain.
module-info.java
module no.djviking.movies {
requires javafx.controls;
requires javafx.fxml;
requires javafx.web;
requires javafx.graphics;
requires org.apache.logging.log4j;
}
org.apache.logging.log4j cannot be resolved to a module
import org.apache.logging.log4j.Logger;
class MoviesApplication {
The type org.apache.logging.log4j.Logger is not accessible