Domanda

Problem:- I want to use the class org.joda.time.Weeks and use it in my code. But I get this error at the import statement import org.joda.time.Weeks; and an error (obviously) where I am trying to use it.

What I have tried: I downloaded the library from here, and included both the .jar files named joda-0.9 and joda-time-0.9 in my project's build path.

I am using Eclipse. Both the jars are at the top and selected, in the order and export section in the Java Build Path configuration.

But I am still getting this error.

I tried to use import org.joda.time.*; but no luck! I am still getting an error when I try to use the Weeks class.

Any suggestions?

È stato utile?

Soluzione

Why did you download the oldest available Joda Time library? In fact, this library (version 0.9) does not contain org.joda.time.Weeks.

I do not know, when this class was introduced, but the latest version - 2.3 - does include it. Download that.

Altri suggerimenti

The class Weeks was introduced in version 1.4 - see the javdoc for the class. Since 0.9 is still an alpha-version you should really use a more modern version - for example the latest version 2.3.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top