title: Java build issues - Java 8 to Java 11 migration
body: <p>We're migrating from Java 8 to Java 11.<br />
  We have a legacy project Y which depends on another legacy project X.<br />
  The project X has no sources, it's just a collection of about 300 jars.<br />
  The build is ant-based, no maven.</p>
  <p>I cannot build the project Y now with JDK 11 (neither in Eclipse, nor externally)<br />
  because it says <em><strong>&quot;The package org.w3c.dom is accessible from more than one module: , java.xml&quot;</strong></em></p>
  <p>I get this error in Eclipse on a line which does <code>import org.w3c.dom.Document;</code></p>
  <p><strong>When I do an external build (with ant, outside of Eclipse) I can build successfully (with basically the same build.xml as under JDK 8)?!</strong> How come only Eclipse is complaining?! Is it because of this javac bug which I reference below.</p>
  <p>I was reading here (these are directly related to my issues):</p>
  <p><a href="https://stackoverflow.com/a/53824670/2300597">https://stackoverflow.com/a/53824670/2300597</a><br />
  <a href="https://stackoverflow.com/questions/57286825/the-package-org-w3c-dom-is-accessible-from-more-than-one-module-unnamed-java">The package org.w3c.dom is accessible from more than one module: &lt;unnamed&gt;, java.xml</a><br />
  <a href="http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-December/014077.html" rel="nofollow noreferrer">http://mail.openjdk.java.net/pipermail/jigsaw-dev/2018-December/014077.html</a></p>
  <p>but I am still unable to fix these build issues.<br />
  I tried 7-8 different things but nothing helps.</p>
  <p>I think the clash is between <code>org.w3c.dom</code> package from some of these 300 jars and the same package in the JDK module <code>java.xml</code>.</p>
  <p>The weird thing is that <code>org.w3c.dom.Document</code> doesn't seem to be present in any of these 300 jars, it's just that other classes from the same package are present in jars.</p>
  <p>I am deadlocked, I see no way to fix this.<br />
  I cannot lightly change project X because it's a shared library used by multiple legacy projects.<br />
  On the other hand, I cannot remove <code>java.xml</code> module from the build path of project Y.<br />
  So I don't know how to approach this.</p>
  <p>Isn't there some way to just say: OK, use the classes from the JDK first, then use those from the JARs (even though they share the same package, they are not the same class).</p>
  <p>What is the right way to fix these errors?</p>