在android java代码中使用common.lang.StringUtils时出现NoClassDefFoundError? [英] Getting NoClassDefFoundError when using common.lang.StringUtils in android java code?

查看:39
本文介绍了在android java代码中使用common.lang.StringUtils时出现NoClassDefFoundError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在代码使用 StringUtils 类或方法的任何地方收到此错误:-NoClassDefFoundError.我已将 jar 文件正确添加到代码中,并且在我的代码中没有显示任何类型的错误(使用 Eclipse Indigo).

有什么地方我遗漏了.我在其他项目中使用过这个 jar 文件,但它们工作正常.

请帮助如果有人遇到类似的问题?谢谢

解决方案

是的,这是因为您的 .jar 文件没有正确导入.按照以下步骤操作 -

  1. .jar 文件放在项目的 libs 文件夹中.

  2. 将其导入到您的项目中.并且,转到项目 -> 属性 -> Java 构建路径 -> 订单选项卡.

  3. 检查,你的.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 -

  1. Place your .jar file in your project's libs folder .

  2. Import it into your project. And, GoTo project -> properties -> Java build path -> order tab.

  3. 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆