Build 1860: Error: No Scala SDK configured for module

Pavel Fatin mentioned in http://devnet.jetbrains.net/message/5268071#5268071 "Scala project configuration was redesigned, facets are now obsolete so you may delete them (no additional re-configurations required)."

However, when I load my existing project with Scala facets and try to build it I get:

Information:Note: Some input files use unchecked or unsafe operations.
Information:Note: Recompile with -Xlint:unchecked for details.
Information:Compilation completed with 1 error and 32 warnings
Information:1 error
Information:32 warnings
Error:No Scala SDK configured for modules

I could not delete the Facets from the Module Configuration dialog so I removed them from the .iml files by hand.  After that I ran File | Invalidate Caches, reopened the project and ran Build | Rebuild Project.  The Messages panel still shows the same error as above.

How do I configure a Scala SDK for a module?  I don't see it anywhere in the menus or dialogs.

4 comments
Comment actions Permalink

Either:

Add $SCALA_HOME/scala-library.jar to the dependencies of each module with .scala files

or

Add $MAVEN_REPOSITORY$/org/scala-lang/scala-library/2.8.0/scala-library-2.8.0.jar

The plugin build from last night will look for the corresponding scala-compiler.jar in location relative to this jar -- either in the same directory in the first case, or in ../../scala-compiler/2.8.0/scala-compiler-2.8.0.jar for the Maven-ised case.

I think Pavel will post more detailed instructions soon, once a few of the teething problems have been sorted out.

-jason

0
Comment actions Permalink

I found a partial solution:
Right click on (bring up context menu on) a module in your project and select Add Framework Support...
In the Frameworks Support dialog select Scala and set Scala Home to the scala-2.8.0-final directory
(If you get a warning about /docs/api/:
   Create a directory called docs (not doc but docs)
   Extract scala-2.8.0.final-devel-docs.tgz and move the api, tools, examples and README.scala-swing to the docs directory you created
   Back in IntelliJ reselect your Scala Home and the warning should disappear)
Follow through the rest of the steps.

This isn't a complete solution because I now get an error about Multiple Scala SDKS for modules

0
Comment actions Permalink

Here's a detailed description of the new approach to project configuration.

Please, try the latest nightly build (several configuration-related bugs were fixed).

0
Comment actions Permalink

I am now comfortably using the new approach in Build 1860 on IDEA EAP 95.413.

I followed a variant of Jason Zaugg's approach:

  1. Add project-library called Scala SDK and include scala-library.jar which is in the ext dir of a module depended upon by all other modules (scala-compiler.jar is in the same ext dir and I understand that this is required, but I haven't tried it with it missing)
  2. Add Scala SDK to Dependencies of every module


Now my Scala-based JUnit 4 tests run and work as expected with the IntelliJ IDEA test runner.  Nice work :)

0

Please sign in to leave a comment.