문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top