Scala compiler not found

It is probably a silly question, but I can't understand what should I do.

Installed IDEA 10.02, scala plugin, JDK 6.24, scala 2.8.1 (unpacked to C:\scala, set SCALA_HOME=C:\scala). Opened IDEA project with scala code and can't compile scala sources. The problem is:
What is wrong? Why IDEA can't find scala compiler?


Scala compiler in IDEA project is represented as a (global or project-level) library.

It seems that the project you opened contains a reference to a global library that is not present in your instance of IDEA.

Please, refer to project configuration guide to create a compiler library for the project.


Thanks for the link.

Do you mean that in such situation manual configuration of existing module should be used? Because new project is not an option, new module is not an option either, scala support is already added to module (so there is no scala in "Add Framework Support..."). But actually there is already scala facet in the module configuration, probably only paths to scala distribution should be fixed, something like in this window:
But I can't find where this path to scala distribution can be configured.


The paths can't be found because the whole library is missing (it's system-dependent).

There are two options:

  • manually create a compiler library (an ordinary library that includes scala-compiler.jar and scala-library.jar) and select it in the facet;
  • remove Scala facet from the modue and then run "Add Framework Support..." wizard.

It happens that I was able to fix it just by doing the following:

  • closed my project,
  • created a new fresh temporary project with scala facet (path to C:\scala was found automatically),
  • closed new temporary project,
  • reopened my project

Now everything is compiled successfully. But this behaviour is rather weird because IDEA should find path to scala automatically as for new project.


So, you've finally created a global Scala compiler library.

That's the way it's supposed to be, there's no automatic Scala distribution discovery because:

  • several versions of Scala compiler may be used;
  • Scala libraries (including compiler) may be bundled with a project (so there's no "Scala distribution" and project is completely portable);
  • Scala compiler or Scala standaed library may be represented not as jar files, but as compiled classes;
  • Maven-based projects use artifacts and know nothing about Scala distribution.

I admit that project configuration is a little bit complicated, but that's an inherent property of the matter.


I think there should be some straightforward way to "create a global Scala compiler library". Probably somewhere in File->Settings and not only via creating new empty scala project. Or there should be some way to configure scala settings from the window on first screenshot with "scala-compiler[not found]".


Please sign in to leave a comment.