Fast Scala Compiler fails in IDEA

Since IDEA supports fsc I'm using it in all my Scala projects, because it's much faster than the standard compiler.  But since 1 or 2 weeks IDEA needs some help to get fsc running (at least on my machine).  When the fsc serer is not already running and I start the compilation in IDEA I always get this error:

Error:Scalac internal error: class java.lang.reflect.InvocationTargetException [sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(, sun.reflect.DelegatingMethodAccessorImpl.invoke(, java.lang.reflect.Method.invoke(, org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(][,,$1(CompileSocket.scala:161),,,, sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(, sun.reflect.DelegatingMethodAccessorImpl.invoke(, java.lang.reflect.Method.invoke(, org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(]
Error:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Caused by java.lang.Exception: fsc failure$1(CompileSocket.scala:161)

The code compiles fine in IDEA when I don't use fsc or when I start the fsc server via my ant script beforehand.  I'm just wondering about this issue, because I think IDEA was already able to start the fsc server in earlier releases and you could compile even without starting the fsc server by hand.  So I'm wondering what's the problem now.

Did someone experienced the same problem or does it depend on my machine?

At the moment I'm using:
IDEA IC-94.426
Scala Plugin 0.3.780
Java 1.6.0_17-b04 (Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode))
OS: Ubuntu lucid (development branch)
Kernel: 2.6.32-15-generic #22-Ubuntu SMP Tue Mar 2 02:23:29 UTC 2010 x86_64 GNU/Linux


i have the same issue (IC-95.24, Scala Plugin 0.3.1070). any help would be appreciated.


i always fix it by
make (obviously fails)-> start fsc -> make again. if it doesn't work, restart fsc, make again.
from then on, make works
(no idea why it fails if i start the fsc and then try to compile)


how exactly do you do "start fsc"?


you need to create a run configuration. you'll see what you need to do once you try to do it


many thanks, i see what you mean. it works on a small test project.

however, i can't get it to work on the scala-lang (compiler, library, partest, etc...) project. i always get a popup with the following error message when trying to run the "Scala Compilation Server" configuration:

"Error running fsc: Scala SDK is not specified"

any pointer how I could fix this?



no, never encountered that one


I can suggest you now to try to run compilation server manually from command line, with right classpath. It doesn't matter how to run compilation server, in your case it seems you can't run compilation server from IDEA by some usability problem (which is impossible to resolve for scala-lang project).

Best regards,
Alexander Podkhalyuzin.


thanks, this works! here's the command line i used:

/home/rytz/Applications/java-1.6/bin/java -Denv.classpath="%CLASSPATH%" -Denv.emacs="%EMACS%" -Didea.launcher.port=7534 -Didea.launcher.bin.path=/home/rytz/Applications/idea-IC-95.24/bin -Dfile.encoding=UTF-8 -classpath /home/rytz/scala/trunk/build/locker/classes/library:/home/rytz/scala/trunk/build/locker/classes/compiler:/home/rytz/scala/trunk/lib/fjbg.jar:/home/rytz/Applications/idea-IC-95.24/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain


Please sign in to leave a comment.