Adding Joda Time Adding Joda Time android android

Adding Joda Time


Since it is an Android project, just referencing the Joda jar file won't do. You'll need to bundle that jar file along with your apk which can be done like this:-

  1. Properties -> Java Build Path -> Order & Export

  2. Check on the joda-time-*-*.jar and click Ok. You're done.


Explanation: Referencing the jar alone will only solve the compilation issues in Eclipse (or any other IDE), but when the apk is created the "joda-time" jar file won't be exported/bundled along with your "apk". That is the reason why it throws the NoClassDefFoundError.

But when you check the joda-time jar in Order & Export, it'll make sure that the jar is also bundled inside/along with your "apk" whenever it is created.