得到一个java.lang.NoClassDefFoundError的每一个jar文件文件、lang、java、jar

2023-09-07 10:45:59 作者:久疚

我最近重新安装我的电脑,Android SDK和Eclipse的安装最新版本。而现在包括在每一个项目,我有,我得到一个java.lang.NoClassDefFoundError的为每个jar文件的每一个项目。

I have recently reinstalled my computer, installed latest version of Android SDK and Eclipse. And now every project that I have, I'm getting a "java.lang.NoClassDefFoundError" for every jar file included in every project.

我是一个Java初学者,我的最后一个星期花在论坛,但不能得到解决它。

I am a Java beginner, I have spend the last week on forums, but cannot get to fix it.

有人能帮帮我吗?

感谢您

推荐答案

您很可能是使用了过期的版本ADT之前重新格式化。邮政ADT 17,图书馆要么需要被复制到项目的文件夹,或者他们需要在构建路径上的出口被标记。否则,该库将无法与二进制APK打包,这样你会得到使用这些库时的NoClassDefFoundError

You were probably using an out-of-date version of ADT prior to reformatting. Post ADT 17, libraries either need to be copied to the libs folder of your project, or they need to be marked as exported on the build path. Otherwise, the libraries will not be packaged with the APK binary, thus you will get NoClassDefFoundError when using those libraries.