开发者

Duplicate package problem

开发者 https://www.devze.com 2023-03-08 03:24 出处:网络
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.

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.

开发者_如何学Go

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号