【问题标题】:Fatal Error: Object scala not found致命错误:找不到对象 scala
【发布时间】:2011-03-22 17:35:23
【问题描述】:

我刚刚在 osx 上通过 macports 安装了 scala

sudo 端口安装 scala28

我创建了一个名为 test.scala 的简单脚本

println("hello world")

当我通过它运行时

scala test.scala

我收到以下错误:

scala test.scala 
error: fatal error: object scala not found.
one error found

有什么想法吗?

** 更新 ** 从 REPL 运行会产生正确的结果,但仍然无法直接使用“scala”

Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :load ./test.scala
Loading ./test.scala...
hi there sir

scala> 

** 更新最终 **

当我执行 ps -ef | grep 斯卡拉 我有几个 scala 编译服务器正在运行,当我关闭它们并重新运行我的脚本时,一切都恢复了。一定是状态不好。

【问题讨论】:

  • 这听起来像是一个类路径问题。当您尝试使用 scalac 编译某些内容时会发生什么?
  • 好吧,为什么不接受答案呢?它对我来说效果很好......

标签: scala


【解决方案1】:

似乎是 FSC 处于错误状态,重新启动了 FSC 编译器

【讨论】:

    猜你喜欢
    • 2013-01-21
    • 2014-10-03
    • 1970-01-01
    • 2011-09-08
    • 2011-12-17
    • 2018-12-21
    • 2012-11-21
    • 2015-03-20
    • 2015-03-28
    相关资源
    最近更新 更多