NoClassDefFoundError after importing an external jar

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

There check all boxes with attached jars.

Sometimes after, may need clear + refresh your project

Hope it will help you,

Share:
13,289
Eric
Author by

Eric

Updated on June 05, 2022

Comments

  • Eric
    Eric almost 2 years

    After importing JSoup, everytime the first line of Jsoup code is run, the app gives me this

    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)
    

    I have heavily researched this topic, and none of the fixes work for me like the lib folder thing, changing the order and export and many others. Any help would be appreciated.

    Classpath:

    <?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>