Hi. I have two jar files, A and B. A is a component, B is a component too, but has some classes that have the same name as some classes in class A. The classes in component B are exptected to override the behaviour of classes in component A. Is there some way to instruct java to give priority to classes in component B when names overlap ?
The classes in component B are exptected to override the behaviour of classes in component A
That sound ugly. Can you explain why they do this?
Overriding methods is easy to do in Java, and doesn't require fixing the load order of classes. Also names in Java should never overlap if you properly package your class files (unless you have more than one version of a class). [ February 02, 2005: Message edited by: Paul Sturrock ]
As far as I know, per default Java searches for classes in jar files in exactly the sequence they appear in the class path. That is, if you put the jar file for B before the jar file for A in the classpath, it possibly already works. I'm not fully sure about it, though.
Nevertheless, Paul is right that it sounds ugly. It's probably even the way to hell.
Can you explain why you need to do this? [ February 02, 2005: Message edited by: Ilja Preuss ]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus