致命错误:找不到对象 scala [英] Fatal Error: Object scala not found

查看:72
本文介绍了致命错误:找不到对象 scala的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I just installed scala via macports on osx

sudo 端口安装 scala28

sudo port install scala28

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

I created a simple script called test.scala

println("hello world")

当我通过

scala 测试.scala

scala test.scala

我收到以下错误:

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

有什么想法吗?

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

** UPDATE ** Running from the REPL yields the correct results but still unable to use "scala" directly

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> 

** 更新最终版 **

** UPDATE FINAL **

当我执行 ps -ef |斯卡拉我有几个 Scala 编译服务器在运行,当我关闭它们并重新运行我的脚本时,一切又恢复了.应该是状态不好.

when I did ps -ef | grep scala I had a couple scala compile servers running, when I shut those down and re-ran my script all was working again. Must have been in a bad state.

推荐答案

似乎是FSC状态不好,重启FSC编译器

appeared to be FSC in a bad state, restarted the FSC compiler

这篇关于致命错误:找不到对象 scala的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆