No scala-compiler*.jar found and can't fix

I am running under windows.  I have IDEA Intellij installed with the Scala plug-in and I have the scala compiler installed on my system.

I git cloned the scalaz library which includes the IDEA project.  I get this compilatiion error:

Please adjust compiler library in Scala facet: no scala-compiler*.jar found

with no hint as how to fix it.  I have looked around on the web but I could not find anything that would suggest how to fix the problem.  I would like to suggest that instead of giving me this error message it asks me where my compiler is if it can't find it and then I can tell it.

In fact, when I install the scala plug-in it shold ensure that there is a compiler available and if not ask me where it is.

Would someone please git clone scalaz and tell me how the IDEA Intellij so that I can use the sytem?

Many thanks!
David

6 comments
Comment actions Permalink

Scala projects need two libraries: scala-compiler (with compiler and library jar) and for running scala-library (only library jar).

IDEA allows for project or global libraries. It's up to you which setup to choose.

1. Go File->Project Structure. Then choose "Libraries" or "Global Libraries" and
2. create both compiler and normal scala libraries and add the appropriate jars
    (or the complete directory; if you don't care you can also create only one library with compiler and library jar for both usages)
3. Set the compiler library by going to modules (still in project structure) and expand the module tree to view the scala facet.
4. select the scala facet and select the scala-compiler library you've just created
5. go back, select the module and there the dependencies tab. Add the scala library. Chances are that there is already a scala library added,
  but you haven't set one up with this name. Remove the old then or change you created library to that name (might be the better option)

Now it should work.

0
Comment actions Permalink

Thank you for your post but I really don't know what to type in.  Could you please elucidate in steps (leaving out exact version numbers) what to type in?

I currently have the scala compiler tree installed at C:\Program Files (X86)\scala

It and the JDE are in my path and quite frankly I just wish the IDE would look in the path for scala, java,...

I had already installed Eclipse and I was able to do that, but I want to use the more powerful IDEA IDE.

Thanks again for your time.

0
Comment actions Permalink

run:

sbt update

This will trigger SBT to download Scala, and other library dependencies, to ~/.ivy2/cache. The IDEA project in the scalaz repository points to these JARs.

0
Comment actions Permalink

That brought in the proper libraries and I'm able to build.  Thank you very much.

Now I'm getting this error when I build and when I google on the error I do not get any help.

error: not found: value sbt
import sbt._



Any suggestions?

I wish there were instructions on exactly how to set these things up and what to do when there are problems.

Thanks again!
David
0
Comment actions Permalink

davidf18 wrote:

That brought in the proper libraries and I'm able to build.  Thank you very much.

Now I'm getting this error when I build and when I google on the error I do not get any help.


error: not found: value sbt
import sbt._


Any suggestions?

I wish there were instructions on exactly how to set these things up and what to do when there are problems.

IDEA is trying to build your project submodule, that contains the SBT build.

You can:

1) delete that module, sacrificing code completion for your build definition
2) don't run a full project build, just build the module you're interested in, usually as a make as a 'before' step in a Run Configuration
3) don't use the built-in IntelliJ make at all, instead use SBT with the idea-sbt-plugin (https://github.com/orfjackal/idea-sbt-plugin/wiki)

I go for 2 or 3, myself.

-jason

0
Comment actions Permalink

Thank you very much!  It works by using option 3.  I just typed ~compile at the SBT console.

Since I'm running 64-bit Windows I did have to change the IDEA IDE to idea64.exe to get the proper java machine.

Thanks again!

0

Please sign in to leave a comment.