How to use scala-time?

后端 未结 4 2035
野的像风
野的像风 2021-02-15 15:46

somebody know scala-time? (https://github.com/jorgeortiz85/scala-time) Have no idea how to use it. I can download it (on linux) and run sbt but theres always the same errormessa

相关标签:
4条回答
  • 2021-02-15 15:58

    That means there's no public version of SBT 0.7.4 compiled against Scala 2.9.1 by the looks of it.

    0 讨论(0)
  • 2021-02-15 15:59

    This is an sbt version problem, and you might be able to work around it by using a different sbt-launch or by changing the build a bit. I get a similar error if I use sbt-launch-0.10.1.jar for this code, but it works fine if I use sbt-launch-0.7.7.jar.

    I'd suspect you're using sbt-launch-0.11.0, and this is causing sbt to look for a compiled version of sbt that doesn't in fact exist.

    Possible fixes are:

    1. Just use sbt-launch-0.7.7 for this code.
    2. Edit the build.properties file to use a different version of sbt.
    3. Get source for sbt-0.7.4, compile with scala 2.9.1 and stash the result in your local ivy repository with the name and location that's being searched.

    Options 1 and 2 worked for me.

    I haven't done #3 for this, but have done similar things for other code. It can be a bit painful...

    You can have multiple versions of sbt-launch and flip between them depending on the needs of a particular codebase.

    Perhaps someone who knows sbt better than I will post a real solution, but I'm hoping this is at least a little helpful.

    0 讨论(0)
  • 2021-02-15 16:07

    Update or remove the sbt version(0.7.4) line from build.properties

    0 讨论(0)
  • 2021-02-15 16:17

    To actually use it (as compared to building scala-time yourself), just add

    libraryDependencies += "org.scala-tools.time" % "time_2.9.1" % "0.5"
    

    to the build.sbt of the project you want to use it in.

    Addition:

    Current versions may want to use

    libraryDependencies += "org.scalaj" %% "scalaj-time" % "0.6"
    
    0 讨论(0)
提交回复
热议问题