导入Future is not a member of scala.concurrent
课程时收到错误Future
。
~/workspace/experiments $ scala
Welcome to Scala version 2.9.2 (OpenJDK 64-Bit Server VM, Java 1.7.0_151).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scala.concurrent.Future
<console>:7: error: Future is not a member of scala.concurrent
import scala.concurrent.Future
^
scala>
我在Ubuntu 14.04上运行它:
~/workspace/experiments $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
有人知道我做错了吗?
答案 0 :(得分:3)
升级Scala版本应该解决它。并不表示Future是scala 2.9.2中scala.concurrent的成员 看到 http://www.scala-lang.org/api/2.9.2/#scala.concurrent.package
VS。 http://www.scala-lang.org/api/2.11.8/#scala.concurrent.package