score:1

Accepted answer

i have intellij idea 11.1.2 build #ic 117.418 with scala plugin version 0.5.913.

i had issue getting the plugin to recognize *.scala file. the forum told me to check the file types setting, and i had to manually add *.scala to scala files.

here are the steps you can follow:

  1. download scala-2.9.2.tgz and expand it as ~/applications/scala-2.9.2/.
  2. download scala-docs-2.9.2.txz and expand it as ~/applications/scala-2.9.2/scala-devel-docs/api/.
  3. from intellij, file > new project...
    • select create project from scratch.
    • type in project name.
    • keep the create module as is. java module is fine.
    • hit next.
  4. keep create source directory checked.
    • hit next.
  5. check scala:
    • keep use scala distribution checked.
    • browse to ~/applications/scala-2.9.2/ that you created above.
    • rename create compiler library to scala-compiler-2.9.2.
    • rename create standard library to scala-library-2.9.2.
    • keep them both project-level.
    • hit finish.
  6. right click src, and select new... > scala class.
    • type hello for name.
    • select object for kind.
    • hit ok.
  7. this should create object hello.
  8. type this in:

    object hello extends app {
      println("hello, world!")
    }
    
  9. right-click on hello icon from the project tree and select run 'hello.main()'. this should print out the following:

    /system/library/java/javavirtualmachines/1.6.0.jdk/contents/home/bin/java -didea.launcher.port=7532 ....
    hello, world!
    
    process finished with exit code 0
    

Related Query

More Query from same tag