| 1. |
Why Do I Get A Duplicate Name Error When Loading A Jar File? |
|
Answer» The most common reason for a "java.lang.ClassFormatError: DUPLICATE name" error is that a .class FILE in the JAR CONTAINS a class whose class name is different from the EXPECTED name. So for example if you have a file called "a/B.class" and it contains a class called "B" or "a.X" instead of the class "a.B" then you will get this error. The most common causes for this PROBLEM are either forgetting to include a "package a;" statement or having a "package" statement with the wrong name. The most common reason for a "java.lang.ClassFormatError: Duplicate name" error is that a .class file in the JAR contains a class whose class name is different from the expected name. So for example if you have a file called "a/B.class" and it contains a class called "B" or "a.X" instead of the class "a.B" then you will get this error. The most common causes for this problem are either forgetting to include a "package a;" statement or having a "package" statement with the wrong name. |
|