Reputation: 861
I have installed scala plugin in IDEA, set scala SDK and created a scala module.But I can only find "Compile" and "Run Scala Console" option.How can I run scala class like java?
Upvotes: 3
Views: 5218
Reputation: 837
I has similar issue, i replaced main
method in class to object Main extends App {}
analogue. After idea restart i could use both variant. it's trouble of intellij.
Upvotes: 0
Reputation: 861
It is a mistake! We should create a object which contains main to run scala application:
class Hello {
}
object Hello {
def main(args: Array[String]) {
println("Hello World")
}
}
Upvotes: -1
Reputation: 2048
change class Hello
to object such as described in :
https://www.jetbrains.com/help/idea/2016.2/creating-and-running-your-scala-application.html
Upvotes: 2