What i don't find is the method used by the JVM when a class is requested and this class may be found in two different jar files under the classpath I know that it's a vary bad organisation ( A sample : in class A there is an instanciation of class B B machin = new B(); In the classpath there are two jar files (file1.jar and file2.jar) each containing a class B Which class B will be used : B of file1.jar or B of file2.jar ? Why ? Regards
Assuming the fully qualified class names are the same, I'd guess the class loaded would be the first class the classloader finds. You could find out by jaring up two identically named class files in different jars, putting them both in the classpath and using this class from an application. Chuck a bit of logging in each class to say which one it is.