Adding joda-time as manageable dependency via sbt

会有一股神秘感。 提交于 2020-01-15 03:30:29

问题


I'm having trouble using joda-time in my scala project in scala-ide. I have the following line:

import org.joda.time.DateTime

But it causes the following error: object joda is not a member of package org

That's what I did:

I put these lines in build.sbt:

libraryDependencies += "joda-time" % "joda-time" % "2.9.3"
libraryDependencies += "org.joda" % "joda-convert" % "1.8"

Then I ran reload in my sbt session.

Then I ran update in my sbt session.

So what did I miss?


回答1:


sbt eclipse fixed the thing.

But it was another issue: scala-ide ceased to find main class when trying to run any module extended from App. Removing src folder and creating it again nailed that bitch down.




回答2:


try to delete all joda-time jars from your computer, and reload the project again, it seems that the jar is corrupted.



来源:https://stackoverflow.com/questions/36681402/adding-joda-time-as-manageable-dependency-via-sbt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!