3

I am missing something simple here.

  • Scala downloaded
  • Scala home set
  • IntelliJ plugin downloaded

When new module is added, scala is chosen:

enter image description here

When new class is created, however, when trying to run it, i get

enter image description here

Looking as module properties, i see

enter image description here

What am i missing please?

James Raitsev
  • 92,517
  • 154
  • 335
  • 470
  • You might try selecting "Application" while adding a new configuration, instead of "Scala Script". (BTW, if you can type "scala" at the console prompt and it starts your environment is probably OK.) – Keith Pinson Oct 14 '12 at 03:03

1 Answers1

3

Two things:

  1. The file you're working with must be a Scala class.
  2. You should have an object declared somewhere (preferably outside of the class).

    object runnableObject {
        def main(args: Array[String]) {
            println("Hello world!")
        }
    }
    

You can then use this object to run your Scala code in IntelliJ.

Makoto
  • 104,088
  • 27
  • 192
  • 230