Im writing a Scala script that uses Joda Time 2.0.
When I try to run my script, I get errors like this:
error: value weeks is not a member of object org.joda.time.Period case "w" => Some(Period.weeks(windowSpecNum))
Im also getting a message for Period.minutes , Period.hours and Period.days .
This is really weird because I have no problem using other Joda time classes, and because this class works fine in Scala REPL:
scala> Period.minutes(5) res0: org.joda.time.Period = PT5M
I tried several workarounds:
error: org.joda.time.Period does not have a constructor case "m" => Some(new Period().withMinutes(windowSpecNum))
and
case "m" => Some(Minutes.minutes(windowSpecNum)) error: error while loading Minutes, Missing dependency 'class org.joda.convert.FromString', required by lib/joda-time-2.0.jar(org/joda/time/Minutes.class)
which doesn't make sense since joda-convert-1.2.jar is in my classpath.
Just to make sure that I didn't do something dumb with types (Im new to Scala) I tried this: val p = Period.hours(5) and got the same error.
source share