Smooth!
It should be possible to configure a global "Use FSC" so one doesn't have to loop thru all your modules enabling it for each one.
Excellent!
However, I noticed that for the SBT 0.7 generated IDEA project, if I set the "project" module to use FSC, FSC is restarted on every rebuild.
Setting "project" to the standard Scala compiler (2.7) and the rest of the modules to FSC (2.9.1) fixed the problem.
The compilation is faster, especially if only parts of the project need rebuilding.
I tried enabling FSC for my fairly large multi-module Maven project, and once again I get the dreaded "Compiler internal error. Process terminated with exit code 1".
idea.log is useless:
2011-09-21 10:20:53,411 [ 34830] INFO - ij.compiler.impl.CompileDriver - COMPILATION STARTED
2011-09-21 10:20:53,574 [ 34993] INFO - lij.compiler.impl.CompilerUtil - Initial VFS refresh took 112 ms: 0 min 0sec
2011-09-21 10:20:58,747 [ 40166] INFO - lij.compiler.impl.CompilerUtil - COMPILATION FINISHED; Errors: 1; warnings: 0 took 5336 ms: 0 min 5sec
Oh! I also got that today. Cleaning caches / restart / complete rebuild didn't help. Installing build 1407 finally helped, and so far no error.
I'm on 1407 already... This is a pretty old symptom, I've been seeing it for years but never managed to pin down a common cause.
FSC is probably also not the culprit, because when I switched back to "standard Scala compiler", the error still appeared. Strange.
not working for me:
Information:Compilation completed with 4 errors and 0 warnings
Information:4 errors
Information:0 warnings
Error: error while loading package, class file 'S:\tools\scala builds\scala-2.9.1.final\lib\scala-library.jar(scala/package.class)' is broken
Error:(class java.lang.NullPointerException)
Error: error while loading Class, class file 'S:\Program Files\Java\jdk1.6.0_20\jre\lib\rt.jar(java/lang/Class.class)' is broken
Error:
![]()
any ideas?
Please, ensure there's no Scala compiler / library versions conflict, then run Rebuild.
set everything to 2.9.1 final, but i still get:
It is likely that you have an empty "Project SDK" (I've just added a proper validation).
still not working, i'm back at the original NPE without stacktrace (used 2.9.1 everywhere). it doesn't seem to matter which jdk is set in the project settings. is there a log that i could switch on which tells me more?
HamsterofDeath schrieb:
not working for me:
Information:Compilation completed with 4 errors and 0 warnings
Information:4 errors
Information:0 warnings
Error: error while loading package, class file 'S:\tools\scala builds\scala-2.9.1.final\lib\scala-library.jar(scala/package.class)' is broken
Error:(class java.lang.NullPointerException)
Error: error while loading Class, class file 'S:\Program Files\Java\jdk1.6.0_20\jre\lib\rt.jar(java/lang/Class.class)' is broken
Error:
![]()
any ideas?
I'm getting exactly the same error and I've no idea what it could be. Maybe a problem specific to version 2.9.1? The examples all seem to be based on 2.9.0.1. I'm using JDK 1.7, but seems to make no difference as Hamster is using 1.6.
i tried both 1.6 and 1.7 and different scala versions - same error everywhere
You may check Real FSC support blog post.
i'm getting the NPE, no matter what i do. anything i can do to get more information?
I'm unable to reproduce the problem, sorry. Is there a sure way to do it (a demo project or a sequence of steps)?
I just created a project from scratch with default options selected. I let the IDE create the global compiler library based on my Scala 2.9.1 home directory, enable FSC. But same error. I'm using a 64-bit JDK, could that be the problem?
I'm using 64 bit JDK, Scala 2.9.1 and both on Kubuntu 11.04 and Windows 7 I had no problems with FSC.
I really like the internal fsc, but I don't need to be notified everytime it starts and stops ![]()
Please remove!
Thanks, Nick.
You are right, I created ticket about it: http://youtrack.jetbrains.net/issue/SCL-3715
Best regards,
Alexander Podkhalyuzin.
I’m finding it impossible to get rid of the “Compiler internal error. Process terminated with exit code 1″ error. Non-fsc compile works fine. idea.log has nothing useful in it. I’m on IntelliJ 10.5.2 with Scala plugin 0.4.1440. My project appears to be identically configured to that of a coworker who is using fsc just fine. I’m on Windows, he’s on OSX. There is nothing on the net that offers any answers. I see a lot of you are using Scala 2.9, but it works fine on my coworkers computer with Scala 2.8.1. Any thoughts?
i can try to reproduce the problem using a virtual machine (oracle virtualbox) and upload that whole thing. that might help, right?
Yes, that would help.
I will also try to repro with a fresh install in a virtual machine. At this point I've tried a billion variations of options and can't get it to work on my dev machine, so a fresh virtual machine would be a good approach.
just a random thing before i go all out: do all people with the mysterious problem have a whitespace in their project path, and those who don't don't?
that seems to be it for me...
I do have whitespace in my path. I will remove the whitespace and report on whether or not it fixed the problem.
HamsterofDeath schrieb:
just a random thing before i go all out: do all people with the mysterious problem have a whitespace in their project path, and those who don't don't?
that seems to be it for me...
That's it. A darn whitespace ...
I created a test project in "TestProject", works. Renaming the folder to "Test Project", and voila, the dreaded error. It's the whitespace. I hope this can be fixed soon.
Thank you Hamster :-)
I removed the whitespace, now it works! I'm excited, I finally get to use fsc ![]()
Thank you very much for figuring it out! We'll fix the problem with whitespaces soon.
The problem is fixed.
once again, the community and jetbrains worked together 24/7/365 to provide everyone with the awesome experience of a fast scala compilation.
i'm going to spend the next 4 hours in my basement incrementally compiling stuff quickly.
I'm having mixed results with my Maven 2.9.1 projects. On a single module project I can start the FSC and get the compliation to work (really sweet). However on my larger project (with multiple modules, some in Scala, some in Java, some POM, and scala definition on the main POM), I can't start the compiler and get an every whenever at least one module uses FSC (internal):
Internal error (Plugin: org.intellij.scala): None.get
I have no white space on the path I'm running IDEA 10.5.2 with plugin 0.4.1461.
On the logs I see the following error:
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:275)
at scala.None$.get(Option.scala:273)
at org.jetbrains.plugins.scala.components.CompileServerLauncher.readPort(CompileServerLauncher.scala:113)
at org.jetbrains.plugins.scala.components.CompileServerLauncher.start(CompileServerLauncher.scala:53)
at org.jetbrains.plugins.scala.components.CompileServerLauncher.init(CompileServerLauncher.scala:37)
at org.jetbrains.plugins.scala.components.CompileServerManager$Start$.actionPerformed(CompileServerManager.scala:129)
at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:506)
at com.intellij.openapi.wm.impl.FocusManagerImpl.a(FocusManagerImpl.java:509)
at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:492)
at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:476)
at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:52)
at com.intellij.openapi.wm.impl.FocusManagerImpl$1.runEdt(FocusManagerImpl.java:82)
at com.intellij.openapi.util.EdtRunnable$1.run(EdtRunnable.java:25)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:662)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:515)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:411)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - IntelliJ IDEA 10.5.2 Build #IU-107.587
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - JDK: 1.6.0_22
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - VM: Java HotSpot(TM) Client VM
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - Vendor: Sun Microsystems Inc.
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - OS: Windows XP
2011-10-13 22:16:05,218 [36159890] ERROR - com.intellij.ide.IdeEventQueue - Last Action: CompileDirty
In between I got the same error as you, the None.get problem. Now it's gone after I finished setting up everything properly, so I don't know exactly "what" fixed it. But here is my configuration, mabye you can compare it with yours...
I have a project with 3 modules, two of them contain Scala code, one is pure Java.
The project (parent) pom.xml contains the following repositories:
<repositories>
<repository>
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
The modules containing the Scala code:
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.9.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
In the IDE in Settings > Compiler > Scala Compiler you should select the bundle Compiler library:
Maven: org.scala-lang:scala-compiler-bundle:2.9.1 (version 2.9.1.final)
Configured this way it works nicely for me.
Hope this helps.
Dirk
My "apparent" configuration is the same, but I still fail to compile using FSC. All my modules have the scala facet (including the Parent which defines the scala versions).
I notices on the project's library list the scala-compiler-bundle is grayed. Don't know the meaning of this. I really don't get what is wrong. Is there any way to debug the FSC startup? When I click on the status bar icon and select Run nothing happens.
Thanks for any advice.
I managed to get it working. Apparently my FSC options where incorrect and the launch failed.
I created a new project from a repository clone and compared all .idea files. In the end it was a bad option on the command line for the internal fsc.
I just tested out the new FSC support, and it looks like it's working great. IDEA 10.5.2 on Win7 x64. Thanks!
Sam
There seems to be some problems with the fsc in nika builds (I'm using 110.187 and 0.5.129). The fsc fails in the incremental compiles, regardless that the code is correct. The full rebuild always works, but the after some changes, the problems start. The problems are always with same code snippets. One problematic place is calling a method that has default parameters.
For example:
def foo(bar: String, baz: String = "default")
then somewhere else:
foo("bar") <--- Compiler says Not enough parameters
As a workaround passing the default argument explicitly makes fsc work.
Another problem appears when using some (but not all) implicit conversions. In incremental compile the fsc can't resolve the implicit conversion.
These problems are quite frequent, the cycle goes something like: full rebuild, code change, successfull incremental build, code change, failing incremental build, full rebuild.
The fsc was working just fine in idea 10.5.2