title: running the first example of playframework in IntelliJ on a Mac OSX
body: <p>In my new mac OSX 10.8.3,
  I install scala 2.10.0, play 2.1.0 and IntelliJ12,
  and create a play project as follows:</p>
  
  <pre><code>#install brew
  &gt; ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
  &gt; brew --version
  0.9.4
  
  # update brew database
  &gt; cd $(brew --prefix)
  &gt; brew update
  &gt; cd $(brew --prefix) &amp;&amp; git pull --rebase
  
  # get scala 2.10.0
  &gt; brew versions scala
  2.10.1   git checkout 79dc6f1 Library/Formula/scala.rb
  2.10.0   git checkout 8ca07aa Library/Formula/scala.rb
  2.9.2    git checkout 8896425 Library/Formula/scala.rb
  ...
  
  &gt; git checkout 8ca07aa Library/Formula/scala.rb   # 2.10.0
  &gt; brew install scala
  &gt; scala -version
  Scala code runner version 2.10.0 -- Copyright 2002-2012, LAMP/EPFL
  
  
  # install play 2.1.0
  &gt; brew versions play
  2.1.0    git checkout 6a70797 Library/Formula/play.rb
  ...
  
  &gt; brew install play
  &gt; play -version
  play! 2.1.0 (using Java 1.6.0_43 and Scala 2.10.0), http://www.playframework.org
  </code></pre>
  
  <p>and I create a play application:</p>
  
  <pre><code>&gt; cd ~/
  &gt; play new myapp
  name: myapp
  Create a simple Scala application
  
  # generate IntelliJ project:
  &gt; cd myapp
  &gt; play
  &gt; idea
  [info] Created /Users/david/myapp/.idea_modules/myapp.iml
  [info] Created /Users/david/myapp/.idea_modules/myapp-build.iml
  </code></pre>
  
  <p>and open the project in IntelliJ:</p>
  
  <pre><code># Install IntelliJ 12 Ultimate Edition
  Download it from http://www.jetbrains.com/idea/
  12.0.4, Build #IU-123.169
  Build on February 13, 2013
  
  # install scala plugin in IntelliJ
  run IntelliJ,
  Preferences -&gt; plugins -&gt; Browse from repositories -&gt; add scala.
  current version: 0.7.134
  
  # open myapp project in IntelliJ
  File -&gt; Open Project, chose the directory /Users/david/myapp
  </code></pre>
  
  <p>Then when I try to run the unit test:</p>
  
  <pre><code>Project -&gt; myapp -&gt; test -&gt; ApplicationSpec -&gt; (right click) -&gt; Run
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>scala: Сompiler library for module bigbrother not found: Right(Project) / Right(scala-2.10.0) 
  </code></pre>
  
  <p>Actually, there are several errors:</p>
  
  <pre><code>in File -&gt; Project Structure -&gt; Modules, there are two modules:
  -myapp
  -mypp-build
  
  File -&gt; Project Structure -&gt; Modules -&gt; myapp -&gt; Scala
     Compiler library: scala-2.10.0 [not found]
     &lt;&lt;&lt; ERROR
  
  File -&gt; Project Structure -&gt; Modules -&gt; myapp-build -&gt; Dependencies:
     scala-2.9.2
     &lt;&lt;&lt; ERROR
  </code></pre>
  
  <p>If I correct the first error as follows,</p>
  
  <pre><code>File -&gt; Project Structure -&gt; Modules -&gt; myapp -&gt; Scala -&gt; Compiler library
  and from the dropdown list I select the second valid option “scala-2.10.0 (version 2.10.0)”.
  </code></pre>
  
  <p>Then, re-running the test, produces the error:</p>
  
  <pre><code>scala: Output path /Users/david/bigbrother/project/target/scala_2.9.2 is shared between: Module 'bigbrother-build' production, Module 'bigbrother-build' tests
  Currently external Scala compiler prohibits output path sharing.
  Either disable the external build mode or configure separate output paths.
  TIP: you can use Project Artifacts to combine compiled classes.
  </code></pre>
  
  <p>What do I need to do to make it work?</p>
  
  <hr>
  
  <p><strong>Update: solution based on the answers from Marius and alexwriteshere</strong></p>
  
  <p>generate IntelliJ project with </p>
  
  <pre><code>&gt; cd myapp
  &gt; play
  &gt; idea no-sbt-build-module
  </code></pre>
  
  <p>(instead of just 'idea')</p>
  
  <p>then,
  Project Settings -> Libraries
  Select "Scala 2.9.2" and click on "-" to remove it.</p>
  
  <p>then,
  Project Settings -> Module -> my_app -> Scala -> Scala-compiler
  in this dropdown list, there is selected "Scala 2.10.0" written in red.
  move to the top of the list, and select "Scala 2.10.0 (version 2.10.0)" written in black/grey.</p>
  
  <hr>
  
  <p><strong>Note</strong></p>
  
  <p>sometimes (I don't know why) the choice "Scala 2.10.0 (version 2.10.0)" written in black/grey is not available in the dropdown list.
  a workaround that works for me to make it available is as follows:
  Project Settings -> Global Libraries -> + -> Java
  select these files scala-compiler.jar, scala-library.jar and scala-reflect.jar from this directory: /usr/local/Cellar/scala/2.10.0/libexec/lib/
  select Ok.
  Give it the name "my scala 2.10.0 bundle".</p>
  
  <p>then, go again to Project Settings -> Module -> my_app -> Scala -> Scala-compiler
  now you have both, the one you just created "my scala 2.10.0 bundle", and the standard one: "Scala 2.10.0 (version 2.10.0)" written in black/grey. select the standard one, and delete the global library you created.</p>
  
  <p>I don't know why this happens, and I really don't want to spend more time finding this out. for the moment, this workaround works for me. but feel free to add a comment if you find out.</p>