Working in eclipse, and not on the command line, clearly indicates that there are several versions of the mailbox in the project.
Example:
You have 3 Jars, Jar X, Jar Y and Jar Z.
If you know that JAR X can already be connected inside JAR Z (in this case, the mailbox, but some other version.
So what is the problem with multiple versions of the same banner? You have two different versions, and you will not know what will be referenced in your project. (therefore, if you are looking for any class from mail-2.jar in your project, you will get a class exception not found if the link is made to mail-1.jar by the class loader)
So how does it work correctly on Eclipse? In eclipse you can see that there is an option for the ORDER library, it will be a link in the same order, but at run time on the command line we used to load as lib / *, which loads everything to assemble, and we wonβt know which lib will load first.
How to identify the culprit and fix the problem?
Option 1:
See the docs page / user guide for the libraries you use to see what they have.
Option 2:
- In eclipse, move the JAR in the question (mail.jar here) to TOP in the class order. (your program should work now)
Now leave the order one by one to find out where you got the error. (if you want to find a jar that causes this problem, duplicate the link)
Remove the jar that has the duplicate link, delete the duplicate inside the JAR and repack it. (If you want to)
source share