I'm deploying an .ear file that contains multiple .jar files. In those jars, I have some POJO's that in some cases have the same package name and class name, but are slightly different, and are archived in different jars.
When a method instantiates one of those classes, is there a standard way to guarantee from which .jar file the class will be loaded?
No. The first class loaded will be the one and only.
I even can't imagine why you try to do so...