Setting up scala with IntelliJ

前端 未结 7 596
萌比男神i
萌比男神i 2020-12-04 06:37

I have Intellij ultimate 11.1, with the scala plugin installed.

I installed scala 2.9.2 using homebrew, which put scala in:

/usr/local/Cellar/scala/2         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 07:21

    Updated for Intellij 11.1.5

    Here's a step by step for any of those who are trying to get Scala in IntelliJ up and running.

    Download Scala Plugin

    IntelliJ > Preferences > Plugins > Browse Repositories... > Scala Click Ok and allow IntelliJ to restart

    Download Scala

    In Terminal enter

    brew install scala --with-docs
    

    Setup symbolic links for IntelliJ discovery process

    ln -s /usr/local/Cellar/scala//libexec/src /usr/local/Cellar/scala//src
    ln -s /usr/local/Cellar/scala//libexec/lib /usr/local/Cellar/scala//lib
    mkdir -p /usr/local/Cellar/scala//doc/scala-devel-docs
    ln -s /usr/local/Cellar/scala//share/doc/scala /usr/local/Cellar/scala//doc/scala-devel-docs/api
    

    Create Project in IntelliJ

    Here you are going to create a Java project from scratch as you normally would. However, in the last step, you will select Scala in the "Technologies" page.

    In the Use Scala Distribution enter /usr/local/Cellar/scala/

    In the Compiler dropdown select scala-compiler

    Click Ok and you are ready to create your first Scala object

    For reference -> http://scalacookbook.blogspot.com/2012/09/scala-for-intellij.html

提交回复
热议问题