When referencing simple .jar files, Eclipse shows an error stating:
The package java.awt is accessible from more than one module:
, jav
I think my flavour of the problem might be useful.
I got this error for classes under javax.xml.stream, by old Maven projects that depend on artifacts like xml-apis, stax-api, or geronimo-stax-api.
Technically, the problem is what others have already said: those artifacts expose the javax.xml.* package without any awareness of Java modules (they were born earlier), so the package goes automatically to the unnamed module, which conflicts with the same package being included in the Java's most recent versions, with its own module name.
That said, the practical solution is essentially to work with Maven exclusions to remove those dependencies from your project and let it use the JDK version instead. Use the equivalent if you're working with another build system. In theory, the JDK recent version might be non backward-compatible, in practice I doubt such JSR specifications changed much over the years and so far I haven't seen any issue with their replacement.