Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JODA time in Java Appengine

Has anyone gotten JODA time classes to work on Google Appengine? I'm using 1.3.4 of the java sdk and I get the following error when trying:

java.lang.NoClassDefFoundError: com/google/appengine/repackaged/org/joda/time/DateTimeZone

I've imported it as well:

import com.google.appengine.repackaged.org.joda.time.DateTime;
like image 496
aloo Avatar asked Jun 09 '10 23:06

aloo


People also ask

What is Joda-Time in Java?

Joda-Time provides a quality replacement for the Java date and time classes. Joda-Time is the de facto standard date and time library for Java prior to Java SE 8. Users are now asked to migrate to java. time (JSR-310).

Is Joda-Time followed in Java 8?

Joda-Time is an API created by joda.org which offers better classes and having efficient methods to handle date and time than classes from java. util package like Calendar, Gregorian Calendar, Date, etc. This API is included in Java 8.0 with the java.

Is Joda-Time deprecated?

So the short answer to your question is: YES (deprecated).

What is the use of Joda-time?

Joda-Time provides support for multiple calendar systems and the full range of time-zones. The Chronology and DateTimeZone classes provide this support. Joda-Time defaults to using the ISO calendar system, which is the de facto civil calendar used by the world.


2 Answers

The real purpose of repackaged classes is for Google to have a private set of classes that they can use and that do not conflict with any known packages. Repackaged classes are not meant to be used by the public and if you do, you do at your own risk. They could be yanked at any time.

You can download JODA and just include it as a dependency, there should be nothing to stop it from working. The names will nor clash with Google's because of the different package.

like image 113
Romain Hippeau Avatar answered Sep 29 '22 11:09

Romain Hippeau


Lots of people love joda too.

I suggest placing the JODA package jar in your lib directory and importing it directly.

    import org.joda.time.DateTime;
like image 35
Stevko Avatar answered Sep 29 '22 10:09

Stevko