I have a class "ISO8601DateFormat" which is present in 2 different jars of (1)."jackson-mapper-asl-1.9.12.jar" and (2)."log4j-1.2.15.jar". It compiles fine since i have added both the jars in the build path of eclipse.But during runtime it couldn't recognize exact class from the (1) jar instead same class is loaded with different package name from (2) jar.
Please gimme a way of loading this class from (1) jar and ignoring the same from (2) jar.Please let me know if you have idea of doing this in manifest file instead of dynamic class loading since i dont want to touch my code.
Thanks in advance and expecting right solution soon folks!
“Same class” entails “same package”. If the classes are in different packages, they are different classes. If they have the same simple names, you may have to use their fully‑qualified names throughout.
If you really have two classes with the same fully‑qualified name in the two .jars, I do not think there is a solution, since the class loaders do not specify any order that they load such classes in so as to resolve the ambiguity. When you do the coding in Eclipse, beware of the dropdown lists from ctrl‑space. Those classes may not appear in the order you expect.
You need to know which .jar the classes are in and which package before you import them.
This discussion is gradually becoming confusing. Please unzip the .jars and search them and find how many ISO8601… classes there are, and which packages they are in.
Could you hold this puppy for a sec? I need to adjust this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop