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(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:61)][scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53), scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:132), scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:161), scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:182), scala.tools.nsc.StandardCompileClient.main0(CompileClient.scala:86), scala.tools.nsc.CompileClient.main0(CompileClient.scala), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25), java.lang.reflect.Method.invoke(Method.java:597), org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:61)]
Error:sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Error:sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Error:java.lang.reflect.Method.invoke(Method.java:597)
Error:org.jetbrains.plugins.scala.compiler.rt.FastScalacRunner.main(FastScalacRunner.java:61)
Error:Caused by java.lang.Exception: fsc failure
Error:scala.tools.nsc.CompileSocket.fatal(CompileSocket.scala:53)
Error:scala.tools.nsc.CompileSocket.getPort(CompileSocket.scala:132)
Error:scala.tools.nsc.CompileSocket.getsock$1(CompileSocket.scala:161)
Error:scala.tools.nsc.CompileSocket.getOrCreateSocket(CompileSocket.scala:182)
Error:scala.tools.nsc.StandardCompileClient.main0(CompileClient.scala:86)
Error:scala.tools.nsc.CompileClient.main0(CompileClient.scala)


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
scala-2.8.0.Beta1-prerelease
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

0
8 comments
Avatar
Permanently deleted user

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

0

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)

0
Avatar
Permanently deleted user

how exactly do you do "start fsc"?
thanks

0

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

0
Avatar
Permanently deleted user

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?

lukas

0

no, never encountered that one

0

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.

0
Avatar
Permanently deleted user

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 scala.tools.nsc.CompileServer

0

Please sign in to leave a comment.