2

导入 JSoup 后,每次运行第一行 Jsoup 代码时,应用程序都会给我这个

09-16 16:43:22.567: E/AndroidRuntime(1085): FATAL EXCEPTION: main
09-16 16:43:22.567: E/AndroidRuntime(1085): java.lang.NoClassDefFoundError: org.jsoup.Jsoup
09-16 16:43:22.567: E/AndroidRuntime(1085):     at me.masterejzz.testapp.StartingPoint$1.onEditorAction(StartingPoint.java:55)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at android.widget.TextView.onEditorAction(TextView.java:4185)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at com.android.internal.widget.EditableInputConnection.performEditorAction(EditableInputConnection.java:138)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:297)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at android.os.Handler.dispatchMessage(Handler.java:99)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at android.os.Looper.loop(Looper.java:137)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at android.app.ActivityThread.main(ActivityThread.java:5103)
09-16 16:43:22.567: E/AndroidRuntime(1085):     at java.lang.reflect.Method.invokeNative(Native Method)

我对这个主题进行了深入研究,但没有一个修复程序像 lib 文件夹、更改顺序和导出以及许多其他问题一样对我有用。任何帮助,将不胜感激。

类路径:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con"            path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con"     path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry exported="true" kind="lib" path="libs/jsoup-1.7.2.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
4

2 回答 2

7
Go to Eclipse -> 
      right click on your Project ->
                       "Properties" ->
                          "Java Build Path" ->
                              "Order and Export" Tab

在那里检查所有带有附加罐子的框。

有时之后,可能需要clear+refresh你的项目

希望对你有帮助,

于 2013-09-16T21:08:54.650 回答
0

NoClassDefFoundError在向我的 JaveEE 项目添加新 jar 时,我遇到了类似的错误。我按照上述步骤确保 jar 正确包含在构建路径中。但是,我仍然收到错误,我的诀窍是删除资源并将其添加到 tomcat 服务器中。

- Go to Servers
- Right click on the server and select "Add and Remove"
- Pick the resource with the new jar then remove it and it
- Restart the server          
于 2019-01-12T14:48:33.693 回答