我有简单的问题。我安装了idea和scala插件。
创建项目并添加想要运行的简单 println("Hello world!")
.
我创建了“scala 脚本”。添加这一行。当我运行它时,出现错误 expected class or object definition
.
我怎样才能运行它并查看输出?
谢谢
最佳答案
根据 Getting Started with IntelliJ IDEA Scala Plugin :
You can also turn your Scala object into a script. Just remove all declarations from the file, leave the executable statement only - println("Hello, World!"), and run the script as described above.
但是,我确认它的结果与您引用的错误相同。我认为这是一个错误(或不准确的文档),提交 bug ,Jetbrains 的家伙们正在非常积极地开发这个插件。
关于scala - 如何在 Intellij Idea 10 中运行 Scala 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7853860/