本文介绍了通过 sbt 添加 joda-time 作为可管理的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 Scala-ide 的 Scala 项目中使用 joda-time 时遇到问题.我有以下几行:
I'm having trouble using joda-time in my scala project in scala-ide. I have the following line:
import org.joda.time.DateTime
但是会导致如下错误:object joda is not a member of package org
这就是我所做的:
我将这些行放在 build.sbt
中:
I put these lines in build.sbt
:
libraryDependencies += "joda-time" % "joda-time" % "2.9.3"
libraryDependencies += "org.joda" % "joda-convert" % "1.8"
然后我在 sbt
会话中运行 reload
.
Then I ran reload
in my sbt
session.
然后我在我的 sbt
会话中运行 update
.
Then I ran update
in my sbt
session.
那我错过了什么?
推荐答案
sbt eclipse
修复了这个问题.
但这是另一个问题:scala-ide 在尝试运行从 App
扩展的任何模块时停止找到主类.删除 src
文件夹并再次创建它就解决了那个婊子的问题.
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.
这篇关于通过 sbt 添加 joda-time 作为可管理的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!