I am trying to migrate my application from Java 8 to Open JDK 11.
In which few of the imports are missing in JDK 11. For example I could not find below imports
import org.w3c.dom.Document;
import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
import org.xml.sax.SAXException;
But when i tired to add external jar for (w3c-dom.jar), we are getting the below error
The package org.w3c.dom is accessible from more than one module: , java.xml
As like the above, same error is occurring for all the imports
The package org.xml.sax is accessible from more than one module: , java.xml
Please suggest your views on the above error.
I faced similar issue, like mentioned below.
The package org.w3c.dom is accessible from more than one module: <unnamed>, java.xml.
Because there was a dependency which internally generating xml-apis.jar , and this jar was actually created the problem. I followed below mentioned steps and it helped me.
Note : It may be a different dependency in your case which generates this xml-api.jar, so find that dependency and exclude xm-api.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.