Eliminate "duplicate library class definitions" in ProGuard

I have a Java project that includes the Xerces library.

When I process a project using Proguard, I get a warning:

Note: duplicate definition of library class [org.w3c.dom.html.HTMLDOMImplementation] 

In Xerces, I see that this class exists and that the same class exists in rt.jar JDK 1.6.

The jar file created by ProGuard does not start (error: "Java exception occurred"). How can I solve this problem? thanks!


(note: I work with Netbeans)

+4
source share
1 answer

1) Or you should remove the class from one of the libraries (which is not recommended, as this may break other classes)

2) Find a jar with this class. E.g. the class that you use in your application may be available in several banks. So, take a jar where this conflicting class is missing, but the other classes you want are present (this may take some time)

3) (and best of all) just ignore the error. I do not think this should give any problems. Based on the fact that jar occurs first in the class path, the class will be raised.

+11
source

Source: https://habr.com/ru/post/1385093/


All Articles