On Thu, Dec 12, 2019 at 9:30 PM Java Dev <d...@m12345.de> wrote: > I'm having issues with xerces 2.12.0 and JPMS / jigsaw (JAVA 11) > > it clashes with jdk.xml.dom module from JAVA 11: > I've a limited knowledge of Java 9+ module system (JPMS / jigsaw). But I'll attempt to answer your questions as best as I can.
Xerces-J has not (yet) been written keeping in view of the Java's module system. I think that, Java's module system was introduced to bring a modularity aspect to Java application design. In a Java 9+ application, we can split (divide, and optionally) an application into various modules, where each module can declare its dependencies (the components it needs from outside the module, and the components the module wants to expose. These are essentially import and export of the modules). An application file module-info.java, has all such meta data details about a module. 2) This is where I get xerces 2.12.0 from: > https://mvnrepository.com/artifact/xerces/xercesImpl/2.12.0 > > Peeking inside the jar file, there is > > org\w3c\dom\html\HTMLDOMImplementation.class > > This results in "split package" which is illegal when compiling on the > module path. > > I have played around with xercesImpl-2.12.0.jar, removing the offending > .class file and directory, and now module path and intellij seem to be ok. > > Any idea how to approach this? I believe that in current status, > xercesImpl 2.12.0 is not compatible with JPMS once jdk.xml.dom module is > required by other dependencies. > I think that, it'll be a significant redesign of Xerces, if Xerces has to comply to Java's module system. We'd need to decide, how to split the Xerces software into various modules, and declare each module's dependencies (the imports and exports of modules, and ideally give each module a name). The Xerces code is now been fixed (improvements coming in Xerces 2.12.1), to compile and run fine on Java 9+ (when used in a pre Java 9+ non module way). The Xerces team, is currently in process to release the version 2.12.1. I don't think that, 2.12.1 version shall address the Java 9+ modularity aspects. But I personally think that, Xerces should address in a future version (looks to be beyond 2.12.1) the issues of Java's 9+ modularity principles (and in particular, the jdk.xml.dom module issues you're facing). Now thinking about, the workaround you can use at the moment, for jdk.xml.dom module issues you're facing, as you've written I think you can remove the offending .class file and directory from xercesImpl jar (its not the best fix, but you can then use all other functionality provided by Xerces-J). If you also wish, you may work with Xerces's source code and produce a fix locally, and could also share best practices and any fix patches with us. -- Regards, Mukul Gandhi