在android java代码中使用common.lang.StringUtils时出现NoClassDefFoundError? [英] Getting NoClassDefFoundError when using common.lang.StringUtils in android java code?
问题描述
我在代码使用 StringUtils 类或方法的任何地方收到此错误:-NoClassDefFoundError.我已将 jar 文件正确添加到代码中,并且在我的代码中没有显示任何类型的错误(使用 Eclipse Indigo).>
有什么地方我遗漏了.我在其他项目中使用过这个 jar 文件,但它们工作正常.
请帮助如果有人遇到类似的问题?谢谢
是的,这是因为您的 .jar
文件没有正确导入.按照以下步骤操作 -
将
.jar
文件放在项目的libs
文件夹中.将其导入到您的项目中.并且,转到项目 -> 属性 -> Java 构建路径 -> 订单选项卡.
检查,你的
.jar
文件是否按1顺序检查和放置.这是主要的事情.
希望这些步骤对您有所帮助.看看下面的图片 -
I am getting this error:-NoClassDefFoundError wherever the code is using StringUtils class or methods .I have correctly added the jar files to the code and is not showing any kind of error in my code(Using Eclipse Indigo).
Is there any kind of point I am missing out. I have used this jar file in other projects but they worked properly.
Please help If any one is getting similar kind of problem?Thanks
Yes, this because of your .jar
file didn't import properly. Follow below steps -
Place your
.jar
file in your project'slibs
folder .Import it into your project. And, GoTo project -> properties -> Java build path -> order tab.
Check, whether your
.jar
file checked and placed in order of 1st. This is the main thing.
Hope these steps helps you. Have a look at below image -
这篇关于在android java代码中使用common.lang.StringUtils时出现NoClassDefFoundError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!