Had a 3rd parties working JAR file in my own project, but I ran into a problem: i needed some customization to do.
- Forked a repository from Github.
- Modified the source code
- Exported the JAR: Left click > Export > Java > JAR file > Default settings
- Imported the JAR to my own Android project: Left click > Import > File system & Left Click on project > Properties > Java Build Path > Add JARs > OK
Now, when I run my program (which was working fine with 3rd parties official JAR) I run into exception on runtime:
11-10 06:22:05.912: E/AndroidRuntime(1125): Caused by: java.lang.NoClassDefFoundError: org.jsoup.Jsoup
When I extract the JAR file, then it contains all the needed class files (including org.jsoup.Jsoup).
NoClassDefFoundError - error reading the class definition. This typically happens when the class in question has static blocks or members which use a Class that's not found by the ClassLoader. Source
As I understand, this seems to be some kind of exported JAR classpath problem?