Search code examples
scala

value joda is not a member of org


I'm new to Scala and would like to do the DateTime using joda.

In Scastie (an online Scala IDE) I wrote this:

import org.joda.time.{DateTime}

But I got the error as the title. I have the same error in my local IDE (IntelliJ). Please help me with this. Thank you.


Solution

  • You're trying to use something from this library: https://search.maven.org/artifact/joda-time/joda-time/2.10.13/jar

    You can include this library in Scastie using the following line:

    addSbtPlugin("joda-time" % "joda-time" % "2.10.13")
    

    You can add this line by going to Build Settings in Scastie and entering the line in the Extra Sbt Configuration section.