Since we are using JDK 11 to compile the Nuxeo Platform, see
NXP-24952, we get these kind of errors in Eclipse when setting the Compiler Compliance Level to 11 in Preferences > Java > Compiler > JDK Compliance.
For instance in DomHelper from nuxeo-commons on:
Basically, this happens on all the packages that are split between classpath (pom.xml) and system image (JDK).
This is only visible in Eclipse because it uses its own Java compiler, which apparently adheres to the Java Language Specification more closely than Oracle's own compiler.
Yet, having for instance both xml-apis and JRE 9+ in our dependencies is no longer valid according to JLS 9+.
It seems that we'll have to remove all dependencies to these "duplicate" packages and always add exclusions to avoid transitive dependencies.
But this is not trivial: to fix the issue with org.w3c.dom, removing dependencies on xml-apis is not enough as it is also exposed by some libs like xercesImpl.
Workaround for Eclipse: set the Compiler Compliance Level to 1.8.
tl;dr A package split between the classpath and the system image is just
as bad as a package split between two modules on the modulepath.
Eclipse is not the cause, we're just the messenger of a situation that has become illegal.
When Java 13 fixes https://bugs.openjdk.java.net/browse/JDK-8215739 your current structure will definitely stop to compile also in maven. Nothing we can possibly fix in Eclipse.
javac does not detect split packages between classpath and system image