user664338
user664338

Reputation:

Duplicate package problem

I am trying to integrate Twitter in my application. I import two .jar files with different names, but one package has the same name in both files. When I compile, it shoes following error.

Description Resource Path Location Type D:\CustomClasses\ksoap2-j2me-core-prev-2.1.2.jar(org/kxml2/io/KXmlParser.class): Error!: Duplicate definition for 'org.kxml2.io.KXmlParser' found in: org.kxml2.io.KXmlParser

Upvotes: 0

Views: 362

Answers (1)

Dilum Ranatunga
Dilum Ranatunga

Reputation: 13374

Assuming the two JARs are third party (not platform libraries), you should consider a more sophisticated compilation and packaging step. But before going down this path, check to see whether the JARs you are importing don't come in different forms -- ones that don't embed their dependencies.

Either way, have a step in your compilation to extract just the parts that you need from each JAR.

If you are not using build scripts but use an IDE for everything, set up a build script just to build your customized dependencies JAR.

Upvotes: 1

Related Questions