Im working on a Scala script that uses Joda Time. Until today, this has worked fine. Somehow, something has changed, and it no longer works.
It works:
$ scala -cp "lib/*" Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_29). Type in expressions to have them evaluated. Type :help for more information. scala> import org.joda.time._ import org.joda.time._ scala> Period.minutes(5) res0: org.joda.time.Period = PT5M
but it does not:
$ scala -cp "lib/*" test.scala /Users/avi/Dev/experiments/rollups/scala/test.scala:4: error: object joda is not a member of package org import org.joda.time._ ^ one error found
test.scala contains only:
#!/usr/bin/env scala -cp lib/* -deprecation !
this also does not work:
$ scala -cp "lib/*" -e "import org.joda.time._" /var/folders/c4/gh5y9_cx5bz8x_4wm060l_mm0000gn/T/scalacmd1248995773392653303.scala:1: error: object joda is not a member of package org import org.joda.time._ ^ one error found
It is also not caused by using * in the cp argument:
$ scala -cp lib/joda-time-2.0.jar:lib/joda-convert-1.2.jar -e "import org.joda.time._" /var/folders/c4/gh5y9_cx5bz8x_4wm060l_mm0000gn/T/scalacmd5438658792813459030.scala:1: error: object joda is not a member of package org import org.joda.time._ ^ one error found
... It's just crazy because it worked the last time I worked on this project, just a day or two ago! And now it does not work, and I think I must have changed something, but to be honest, I can’t think what it could be.
Help!
source share