Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Java%20Beans%20Interview%20Questions%20and%20Answers

Question: 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.

Themost common causes for this problem are either forgetting to include a "package a;" statement or having a "package" statement with the wrong name.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook